Closed
Description
Hello,
I'm currently working for a french retailer and we had an issue with some pdf uploads.
Those pdf (Orange invoices used as address proof), are recognized as application/octet-stream by file -b -mime and finfo_open.
So we used pdfinfo from popplers project to identify it as pdf.
However we have two problems with current implementation.
- We register new mime type guesser in bundle boot method as explained here, https://stackoverflow.com/questions/31390328/symfony-where-do-i-put-the-code-to-register-a-custom-mimetypeguess
But that's mean this part of code is called in every request and not only every time we need to check a file. - This command pdfinfo, is called for every uploaded file, not only pdf one, as an array_unshift put our custom guesser as the preferred one.
Do you have any idea on how to improve on this ?
Adding some configuration possibility was what we tought of, but maybe there is other ways to get a more optimal solution to get some generated pdf used as official document to be accepted as pdf.
Thanks for your help