Closed Bug 953274 Opened 7 years ago Closed 7 years ago

PDF File upload : wrong mime type (js)

Categories

(Core Graveyard :: File Handling, defect)

26 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: helmut_rhomberg, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files)

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'.
Attach a testcase (HTML file), please.
Flags: needinfo?(helmut_rhomberg)
Keywords: testcase-wanted
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)
Attached file example.html
I got the right type on Win 7, so Linux issue, probably.
Component: Untriaged → File Handling
Product: Firefox → Core
On Ubuntu 13.10 with Firefox 26 installed, it works perfectly.
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.
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.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
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.