pattern-library icon indicating copy to clipboard operation
pattern-library copied to clipboard

Add better documentation for `allowedFileTypes` on the AXAFileUpload

Open corsin-ragettli opened this issue 3 years ago • 1 comments

Currently, the documentation (Storybook) only states the following about allowedFileTypes:

In the allowedFileTypes attribute, you can declare the allowed file types that a user can upload (ex: only pdf's are allowed). If the attribute is empty, every file type is allowed.

The user can only guess which format this attribute should have. According to mozilla file inputs accept both extensions (i.E. .docx) or MIME types (i.E. image/png). After some testing I found out only the latter was true for the AXAFileUpload. My suggestion is to change the documentation so the user understands how to correctly use this attribute.

My suggestion:

In the allowedFileTypes attribute, you can declare the allowed file types that a user can upload (ex: only pdf's are allowed). If the attribute is empty, every file type is allowed. The allowed File types should be in the MIME Standard. The allowed file types should be separated by a , for example text/plain, image/jpeg, image/png.

corsin-ragettli avatar Jan 18 '23 09:01 corsin-ragettli

Thank you @corsin-ragettli. We will update the docs.

MKaHead avatar Jan 19 '23 12:01 MKaHead