HTML File upload field style

后端 未结 5 1865
旧时难觅i
旧时难觅i 2021-01-19 03:10

I am trying to create a file upload field that has a little bit of style to it, but I seem to be having problems finding examples of this. I know part of the reason is that

5条回答
  •  终归单人心
    2021-01-19 03:51

    If you are using jQuery, have a look at this plugin - https://github.com/ajaxray/bootstrap-file-field

    This tiny plugin will display the file input field as a bootstrap button (with configurable classes) and will show selected file names (or selection errors) beautifully.

    Additionally you can set various restrictions using simple data-attributes or JS settings.
    e,g, data-file-types="image/jpeg,image/png" will restrict selecting file types except jpg and png images.

提交回复
热议问题