Examples of using and configuring Bootstrap File Field in various ways.
Note: On server end, you'll receive the files with submitted form (with enctype="multipart/form-data"
).
No ajax upload is being used.
You can activate plugin on a file field by adding attribute
data-field-type="bootstrap-file-field"
or using javascript (see examples above).
Then you can use the following settings keys (as parameter to javascript activation function)
or data attributes to configure your file field.
What to configure | JS Settings key | Data attribute | Default |
---|---|---|---|
Button label | label | data-label |
Select File Select Files M |
Button class | btnClass | data-btn-class | btn-default |
Allowed file types by mime type
(comma separated values) |
fileTypes | data-file-types | Ignored |
Preview thumb | preview | data-preview | off |
Maximum file size (in byte) | maxFileSize | data-max-file-size | Ignored |
Minimum file size (in byte) | minFileSize | data-min-file-size | Ignored |
Maximum total file size M | maxTotalSize | data-max-total-size | Ignored |
Maximum number of files M | maxNumFiles | data-max-num-files | Ignored |
Minimum number of files M | minNumFiles | data-min-num-files | Ignored |
M = For multiple file