Forum

Thread tagged as: Question

Uploading only PDF files to bucket

Is there a way of only uploading a particular files type to a bucket?

For example: bucket="PDFs" accept="pdf"

Why? Because editors are editors.

David Owen

David Owen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have pdf configured as a file group in your filetypes.ini ?

No. Thanks where's the documentation on that?

..can a bucket be configured as a file group?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's here: https://docs.grabaperch.com/docs/form/template-tags/input/file/

No, your label (e.g. 'pdf') lists acceptable file mime types.

Would that stop editors uploading an image to the (ideally) PDF only bucket?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes - sorry, I thought that's what you were trying to do.

If not, what are you trying to achieve?

I've got a bucket ideally of only PDF's (called 'PDFs'). But it is possible to incorrectly upload a jpeg it its place leaving a bucket of PDF's and images called 'PDFs'. This field is intended for a file (PDF) download.

Can a bucket be restricted to a filetype e.g only upload a PDF?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, but a file upload field can be configured to only accept PDFs.