Accept option in file fields

Is there a shortcut on the accept parameter rather then having to list out mime types?

Id like to do something like:

accept: images

And just have it know the mime types for all kinds of images, but still maintain the ability to fine tune with mime types. I looked in the docs but doesn’t seem like there is one.

Not thoroughly enough :wink:

accept:
  mime: image/*
1 Like

Oh well I did just read that page! I have had :beers: though. Also, its kind of buried in an example and not terribly obvious… :slight_smile:

Next thing you’ll tell me is that I secretly and quickly added it before I posted my answer…

Yes! yes you did! :stuck_out_tongue:

If i wanted to do it on documents (doc, zip, xls etc)… what would the shortcut be? Im guessing the mime types vary on those.

application/* should get you quite far. It will include non-documents as well, but it’s pretty close.

Otherwise you can add a comma separated list of supported mime types.

With more control comes more stuff to type… Custom validators would be nice, define once, reuse forever…

… and googling the mime types…which is what i was trying to avoid. Given that kirby supports a finite set of file types for each kind of document, it would make sense to just able to do accepts: documents, but still have the ability to limit to to just word docs for example, via the mime types.

Put it on the Christmas wishlist, aka ideas repo…

Remind me where that is please…

Thanks @bnomei … idea raised… @texnixe I hope i dont have to wait until xmas :astonished: