If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

File type of uploaded pdf file through browser being given as 'application/octect-stream'

RESOLVED DUPLICATE of bug 373621

Status

()

Firefox
File Handling
--
major
RESOLVED DUPLICATE of bug 373621
8 years ago
3 years ago

People

(Reporter: richsummers, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2

When I use Firefox to upload a pdf to a php script, the browser is sending the file with the mime type 'application/octect-stream'. Yep! octeCt, it's got an extra c in there. 

Also - it should be application/pdf no? I'm viewing the mime type through print_r($FILES);

When I try the same upload in Safari, it works fine, with the correct mime-type, so it can't be the server, it must be the client - in this case Firefox.



Reproducible: Always

Steps to Reproduce:
1. Upload a file to a PHP script using standard form controls and a standard multipart/form-data enctype attribute in the form.
2. print_r($_FILES) on the server to see the response
3. Be amazed at the misspelt mime-type, and then confused at its incorrectness.
Actual Results:  
Array
(
    [document] => Array
        (
            [name] => richmond-buses.pdf
            [type] => application/octect-stream
            [tmp_name] => /Applications/MAMP/tmp/php/phpEgmSnL
            [error] => 0
            [size] => 54523
        )
)


Expected Results:  
Array
(
    [document] => Array
        (
            [name] => richmond-buses.pdf
            [type] => application/pdf
            [tmp_name] => /Applications/MAMP/tmp/php/phpEgmSnL
            [error] => 0
            [size] => 54523
        )
)

I believe this will affect all file uploads of pdfs, using my build of the browser...?
Does the bug occur in Safe Mode?
http://kb.mozillazine.org/Safe_mode

This sounds like an addon problem to me.  If it's fixed in safe mode, that's probably what it is.

Comment 2

8 years ago
I have a similar problem: uploaded PDF files are sent with Content-type: text/html instead of application/pdf. Thus it's impossible to upload PDFs if the server side application allows e.g. only PDF files to be uploaded.

Platform is Ubuntu 9.10

Firefox versions I have tested are 3.5.6 and 3.5.7
Exact user agent string of the latter is:

Mozilla/5.0 (X11; U; Linux i686; it; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7

I can confirm this bug is reproducible also in -safe-mode.

Comment 3

8 years ago
To be sure it was a FF bug an not a PHP or other server misconfiguration issue, I uploaded the exact same file both with FF and IE7 on Windows XP SP3. With IE7 I had no problem as the file was reported to be application/pdf by the browser, thus it was allowed by the upload application.

I will attach a wireshark dump of the two upload sessions.

Comment 4

8 years ago
Created attachment 420711 [details]
Wireshark dump of HTTP session where a PDF file is uploaded with FF and beign erroneously sent as text/html.

Comment 5

8 years ago
Created attachment 420712 [details]
Wireshark dump of HTTP session where a PDF file is uploaded with IE7 and beign correctly sent as application/pdf.

Comment 6

8 years ago
Strangely enough, now FF uploads the same file as application/force-download! (see attachment).

Comment 7

8 years ago
Created attachment 420717 [details]
Wireshark dump of HTTP session where a PDF file is uploaded with FF and beign erroneously sent as application/force-download.

Comment 8

8 years ago
Solved: I had an entry in mimeTypes.rdf where pdf was associated with application/force-download

Deleting that RDF entry solved the problem.

See also bug 535384

Comment 9

7 years ago
same as bug 547234
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 373621
You need to log in before you can comment on or make changes to this bug.