-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Allow all file types in Documents except for images and videos. The Media collection is for images and videos.
The DocumentBlock should be updated to have two layout variants:
- Embed in an iframe (current behavior)
- Show a download link
We might want logic to only allowing embedding in an iframe for some mime types - or we could just trust users to make this decision (and maybe default to the download link layout option).
There isn't an ideal way to implement "all but images are allowed" logic for the Documents collection because the mimeTypes field is an allow list: https://payloadcms.com/docs/upload/overview#mimetypes
We could accomplish that "all but images are allowed" logic using a hook with correct error messaging to users in a toast (Payload's error notification pattern) but we lose the nice UX of only allowing users to select file types in the file upload modal (i.e. the system file picker that pops up from the html file input) that they are actually allowed to upload. That's probably something we can accept though.
We could also see about opening a PR to use a deny list for mime types in Payload.