If you configure a lot of allowed file types and you upload a wrong file type, you get the error message of locale.strings.youCanOnlyUploadFileTypes which is really hard to read.
Because there is no "smart" variable available in locale.strings.youCanOnlyUploadFileTypes you can not overwrite this behaviour. The configured file types are just appended to the locale string.
I tried some events and methods (onBeforeFileAdded, error), but could not find a useful workaround.
E.g. restrictions.allowedFileTypes
'image/*', 'video/*',
'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/rtf',
'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.text',
'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'text/csv', 'text/plain'
]
good point鈥擨 opened #1374 which will allow you to do something like
youCanOnlyUploadFileTypes: 'Unsupported file type',
// or
youCanOnlyUploadFileTypes: 'You can only upload text files, MS Office files, images, and videos',
the list of file types will only be included if you explicitly use %{types}. thanks for the report!
Closing, since https://github.com/transloadit/uppy/pull/1374 was merged 馃憤
Most helpful comment
Closing, since https://github.com/transloadit/uppy/pull/1374 was merged 馃憤