You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
Alternatively, I think, it should be possible to conditionally register your guesser either in the route handler just before validation, or if necessary, via an event listener that runs after route resolution (or whatever other step is important for determining the relevance of the request), but before your validation.
This PR was squashed before being merged into the 4.3-dev branch (closes#29896).
Discussion
----------
[Mime] Add the component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28832#21985 makes #15460 trivial
| License | MIT
| Doc PR | symfony/symfony-docs#10886
This has been on my todo-list for X years :)
Commits
-------
bdca5d9 tweaked code
5268389 [Mime] added freedesktop as a source for mime types
74ca91d [Mime] added the component
d7ee0ec [HttpFoundation] updated File code
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.
But that's mean this part of code is called in every request and not only every time we need to check a file.
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
The text was updated successfully, but these errors were encountered: