how to limit uploaded file types in nuxeo platform

267 views Asked by At

My question is about the nuxeo platform, i want to limit the uploded file types to jpg and png images only. I googled and searched the documentation and found nothing. is there a way to do this? Thanks

1

There are 1 answers

0
joecullin On

If you're using WebUI, the upload providers support an "accept" attribute, where the value is a comma-separated list of accepted mime types.

https://doc.nuxeo.com/nxdoc/web-ui-upload-providers/

Here's an example:

    <nuxeo-dropzone role="widget"
                label="PDF file"
                name="content"
                accept="application/pdf"
                document="[[document]]"></nuxeo-dropzone>

Note, the Dropzone component isn't very good at reporting errors back to the user. It fails silently if you upload a type that's not accepted.