2

I am having a problem specifically with uploading PDF files when using Firefox (27.0.1).

Currently, I have the following in my mimes.php file:

'pdf'    =>    array('application/pdf', 'application/x-download', 'application/octet-stream', 'application/binary', 'application/unknown'),  

I have tried many variations of the above, and nothing has worked so far.

Has anyone found the proper type to add for PDFs that works with Firefox?

8
  • did this happen when u login as superadmin??
    – Ahmad Saad
    Commented Mar 14, 2014 at 22:30
  • yes... but not if I upload the pdf straight from the admin panel. This is an issue with Firefox specifically where it does not send pdfs with the proper mimetype when you submit them through forms on websites.
    – enga
    Commented Mar 14, 2014 at 22:40
  • If anyone knows how I can get FreeForm to show me what mimetype it is getting and return that as part of it's returned upload errors, that would be amazing! I can't even find a way to get my template to show me what mimetype was received from FF.
    – enga
    Commented Mar 14, 2014 at 22:52
  • 1
    Assuming you're running the latest version (4.1.3), add the following code to line 232 of /system/expressionengine/third_party/freeform/act.freeform.php (move the foreach to line 233): die('<pre>'.print_r($_FILES,TRUE).'</pre>');. That should give you the mime-type as the server sees it. Commented Mar 17, 2014 at 18:52
  • @enga hi I reread your all comments here, so try this first login as subperadmin , create an EE native form(channel:form) and try to upload the same pdf file you success to upload form CMS and let me know if this work.
    – Ahmad Saad
    Commented Mar 18, 2014 at 10:53

4 Answers 4

3

I've seen instances where PDF uploads won't work in Firefox if you've got ExpressionEngine XSS filtering file uploads. In Admin -> Security and Session Preferences, set "Apply XSS Filtering to uploaded files?" to "No".

I'm not a fan of disabling security measures like this, but I've found no other solution.

2
  • I frequently need to turn off XSS filtering for uploads as well. Commented Mar 17, 2014 at 0:56
  • Unfortunately this is already something I had done.
    – enga
    Commented Mar 17, 2014 at 14:28
2

try to use this one

'pdf'    =>    array('application/pdf', 'application/x-download', 'application/download') 

and tell me

and you can always solve this problem by rename the mimeTypes.rdf file which you can find in

AppData\Roaming\Mozilla\Firefox\Profiles\

Regard's.

2
  • I am going to try this one and see. As far as renaming the mimeTypes.rdf file, that would be good for me, but still wouldn't solve anything for users of our site that happen to use Firefox. Thank you, I will get back with whether those mimetypes work for me or not!
    – enga
    Commented Mar 17, 2014 at 14:29
  • I'm afraid this didn't work either. :(
    – enga
    Commented Mar 17, 2014 at 14:36
0

-edited out-

Going by http://ellislab.com/forums/viewthread/92552/ -> https://bugzilla.mozilla.org/show_bug.cgi?id=332690#c24

edit:

Check out your mimeTypes.rdf and let us know if there's anything funky there, all the variants there are in your mimes.php, etc.

edit 2::

woops, sorry didn't realize there was more to the original array, thought it was just 3 types in there.

1
  • Thanks notacouch. I've had a look at the .rdf and I am not seeing anything weird. <RDF:Description RDF:about="urn:mimetype:application/pdf" NC:value="application/pdf"> <NC:handlerProp RDF:resource="urn:mimetype:handler:application/pdf"/></RDF:Description>
    – enga
    Commented Mar 19, 2014 at 14:46
0

Check this bolg, it seems that there are some solutions

http://mrvtech.blogspot.fr/2015/12/firefox-cant-upload-pdf-files-here-are.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.