action: 'upload',
// is true if multiple files can be uploaded at once
multiple: false,
+ // array of accepted file types, null if any file type is allowed
+ acceptableFiles: null,
// name if the upload field
name: '__files[]',
// is true if every file from a multi-file selection is uploaded in its own request
if (this._options.multiple) {
elAttr(this._fileUpload, 'multiple', 'true');
}
+ if (this._options.acceptableFiles !== null) {
+ elAttr(this._fileUpload, 'accept', this._options.acceptableFiles.join(','));
+ }
this._fileUpload.addEventListener('change', this._upload.bind(this));
this._button = elCreate('p');