agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.4k stars 523 forks source link

[Request] Add file type filter to Asset field #937

Open andrevvm opened 5 years ago

andrevvm commented 5 years ago

It would be nice to be able to limit Asset fields by file type, either by MIME, extension, or categorized type (i.e. Kirby CMS).

pauloamgomes commented 4 years ago

Think that makes all sense, currently Cockpit permits to limit the upload (global) based on a whitelist rule in the configuration. However, that is not practical for some cases, e.g.:

Such configuration should reside in the field definition, e.g.:

{
  "pattern": "*.png|*.jpg|*.pdf"
}