[FIX included] Firefox 3.0.3 PDF upload problem |
[eluser]janogarcia[/eluser]
Firefox 3.0.3 is setting the pdf type as "application/download" in the $_FILES array. CodeIgniter will fail to validate it against the pdf array specified in application/config/mimes.php Code: 'pdf' => array('application/pdf', 'application/x-download') Change it to this if you are experiencing problems Code: 'pdf' => array('application/pdf', 'application/x-download', 'application/download')
[eluser]Bogdan Tanase[/eluser]
Yeah, that is indeed a problem. It appears that each browser with each release sends a different MIME type. And not just for pdfs...
[eluser]JoostV[/eluser]
Firefox 3 also sets the Mimetype for some Word documents to a string that is not in config/mimes.php. Codeigniter will fail to validate those Word documents. Code: 'doc' => 'application/msword' Code: 'doc' => array('application/msword', 'application/vnd.ms-word') Frustrating, this is. I'll have to upload an update mimes.php into all codeigniter sites now...
[eluser]Unknown[/eluser]
It gets ever better... When uploading a CSV file, I found that Firefox 3.0.5 reports the MIME-type as \"x-comma-separated-values\" (with the \ and "included!!!!) instead of x-comma-separated-values and Explorer 7 reports it as text/plain Grrmbbbllll....
[eluser]Unknown[/eluser]
i have the same problem. but i fix it by editing the mimes.php Code: 'pdf' => array('application/pdf', 'application/download', '\"application/force-download\"', 'application/force-download', '\"application/download\"', 'application/x-download', '\"application/x-download\"', '\"application/pdf\"'), after that i able to upload the pdf files.
[eluser]Bogdan Tanase[/eluser]
I think we all know hot to fix it, but unfortunetly with each new browser version a new mimetype appears... It's pretty annoying. Maybe the upload class needs a revision and make the mimetype validation optional.
[eluser]Unknown[/eluser]
I use Firefox 3.5.3 It's can't to see the file type when I uploaded .pdf T_T
[eluser]Unknown[/eluser]
FF 3.0.14 sets the MIME of PDF files as 'application/doc' which is pretty annoying. Optional mimetype validation seems a good idea. Maybe in CI 1.7.3?
[eluser]Unknown[/eluser]
This behaviour (for me, I got "application/x-pdf" instead of "application/pdf") doesn't seem to be a problem of Firefox using different MIME types with each new release but is obviously due to a bug which corrupts the mimeTypes.rdf: https://bugzilla.mozilla.org/show_bug.cgi?id=332690 Unfortunately this bug from 2006(!) is still not fixed. |
Welcome Guest, Not a member yet? Register Sign In |