Uppy: Hard to read allowed file type error message

Created on 25 Mar 2019  路  2Comments  路  Source: transloadit/uppy

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' ]

Bug

Most helpful comment

Closing, since https://github.com/transloadit/uppy/pull/1374 was merged 馃憤

All 2 comments

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 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

anushkamds picture anushkamds  路  3Comments

matthewhartstonge picture matthewhartstonge  路  3Comments

quetzyg picture quetzyg  路  3Comments

hikurangi picture hikurangi  路  4Comments