pqina / filepond-plugin-file-validate-type

🚦 File Type Validation plugin for FilePond
https://pqina.nl/filepond
MIT License
33 stars 14 forks source link

webp files allowed through, although limitation is 'image/jpeg' #20

Closed phtmgt closed 4 years ago

phtmgt commented 5 years ago

The file gets written to filesystem with jpeg extension, but it is still webp inside. It breaks other stuff on our server that does not support webp.

rikschennink commented 5 years ago

If you want to do deep inspection of files you can't rely on browser mime types and file extension, in that case you can use the fileValidateTypeDetectType method. https://pqina.nl/filepond/docs/patterns/plugins/file-validate-type/#custom-type-detection

phtmgt commented 5 years ago

Got it, thanks. Since we are using the react version and it is not quite clear how to do this there from the docs, we'll just intercept webps in the backend.