I think I miss somethig here about the files upload restriction.
I see that we can restrict the files upload to some mime-type but according to the doc https://getkirby.com/docs/reference/panel/blueprints/file#accept it seem to cover all files from all fields ?
How to tell my gallery field to accept only image (png, jpg, jpeg), and tell another field to accept only MP4 video ?
In the files blueprint for the images, you can put:
And you can make another files blueprint for videos
Via a file template, where you can set the
I tried and that don’t work directly on the blueprint for a field with a files type.
For what I understand, this should work or I totally miss everything and need to sleep a little ?
No, the accept options goes into the file blueprint.
If your file blueprint is called
Title: Gallery template
And the upload template syntax:
Or if you want to set an explicit page to upload to (other then the current page)
Get some sleep sounds like a great idea.
Thanks for your help @texnixe. Yep I might go to sleep now! It’s was finally simple… But maybe it need an explaination on the Kirby doc on how to do it ? Or in the Cookbook.
Hm, it’s actually in the links I posted above, where would you expect this to be explained? Or do you mean the step from the field to the accept option in the blueprint? Yes, I guess we can make this clearer.
Sorry to wake this thread up again. I am struggling with disallowing only tiffs from upload. This is my complete file blueprint “work-image.yml”:
title: Work Image
mime: image/jpeg, image/png, image/webp, image/gif
label: Work Title
help: Google likes this, so try to fill it out as often as possible.
Even though it should be correct my client can still upload tiffs which cant be properly displayed (and are sometimes even like 16bit files).
Could you provide the blueprint where you are assigning this work-image.yml to your section/field?