PDF File upload : wrong mime type (js)

RESOLVED WORKSFORME

Status

defect
RESOLVED WORKSFORME
6 years ago
3 years ago

People

(Reporter: helmut_rhomberg, Unassigned)

Tracking

({testcase})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Reporter

Description

6 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131215161728

Steps to reproduce:

The bug https://bugzilla.mozilla.org/show_bug.cgi?id=891334 which was fixed a while ago describes this as best.


Steps to reproduce:

I am using an input of type file to upload pdf using ajax on Firefox 26.0

I'm using the following System and Browser:
Firefox (Package name): firefox-26.0-3.fc20.x86_64
Linux: 3.12.5-302.fc20.x86_64
Fedora: 20 (with all available updates, 27.12,2013)


Actual results:

I want to check the file mime type to be sure to get a pdf.
So I am using this javascript : 
var file = uploader.container.find('input[type="file"]')[0].files[0];

then I check the property  'type' of the file var. (file.type)

The value is 'application/octet-stream' instead of 'application/pdf' !


On a Windows System the Bug doesn't exist with Firefox 26.


Expected results:

The value of file.type should be  'application/pdf'.

Comment 1

6 years ago
Attach a testcase (HTML file), please.
Flags: needinfo?(helmut_rhomberg)
Keywords: testcase-wanted
Reporter

Comment 2

6 years ago
steps:
1. unzip the archieve
2. open example.html in Firefox 26 (Fedora package)
3. choose the lorem ipsum test pdf.pdf
4. see the result as a javascript alert --> binary/octet-stream
Flags: needinfo?(helmut_rhomberg)

Comment 3

6 years ago
Posted file example.html

Comment 4

6 years ago
I got the right type on Win 7, so Linux issue, probably.
Component: Untriaged → File Handling
Product: Firefox → Core
Reporter

Comment 5

6 years ago
On Ubuntu 13.10 with Firefox 26 installed, it works perfectly.

Comment 6

6 years ago
So is the issue only on Fedora?

Did you install Firefox from mozilla.org and not from the OS package?
This may be a duplicate of bug 373621. Take a look at the mimeTypes.rdf in your profile directory and look for entries referring to the pdf extension.
Reporter

Comment 8

6 years ago
I installed the os package.

Sorry, this is not a Firefox bug. Something must went wrong during the upgrade process from Fedora 19 to 20.
I solved the problem by deleting the .mozilla folder in my home directory ("~/.mozilla").

Thank you for your efforts.
Reporter

Updated

6 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
Reporter

Comment 9

6 years ago
Yes my mimeTypes.rdf contains the wrong value for .pdf files.

<RDF:Description RDF:about="urn:mimetype:binary/octet-stream" NC:value="binary/octet-stream" NC:editable="true" NC:fileExtensions="pdf" NC:description="PDF-Dokument">
<NC:handlerProp RDF:resource="urn:mimetype:handler:binary/octet-stream"/>
</RDF:Description>
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.