statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Restrict Upload to Asset Container to file types #1029

Closed exophunk closed 11 months ago

exophunk commented 11 months ago

Afaik, there is no way to restrict asset containers to specific file type (mime?) e.g. only images?

We have multiple containers, e.g. (Images, Documents, Icons). I can restrict mime to jpg,png,gif when creating an asset field with validation rules, but how I can I prevent users to go to "Assets" and upload whatever random *.exe file they want in the CP?

I'd like them to only upload PDF to the "documents" container, whether they do it through a field or direct in the asset containers view.

Also for security reasons, I think it is not good to have no option to prevent CP users to upload whatever they like. Even if you can validate the fields, you should be able to prevent upload of EXE etc.

https://discord.com/channels/489818810157891584/1138020315440627772

jasonvarga commented 11 months ago

Duplicate of #2