Field level upload mimetypes #653
slawekniewiadomski
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Aloha!
it would be nice to be able to change collection mimetype check on field level basis.
For example, we have "Media" collection with mimetypes set to
['image/*','video/*']
, and we have "Pages" collection.In page we add block "image" which has an upload field. Now i can upload image OR video, but i would like to limit this to images only.
Workaround using custom
validate
in upload field in this case breaks UX, because user can upload video, and then only on save he gets feedback that he should use image. It would be better to bail on file picker modal.I'm no react dev (Vue guy here), but i can see that we could pass a prop from upload field to filepicker on click, and in filepicker, check not only against collection mimetypes prop, but also against fields mimetype prop. It would require adding additional
mimetypes
prop to upload field though.If someone could guide me where i should look to do this, i can try to create code and PR for that :)
Beta Was this translation helpful? Give feedback.
All reactions