Closed
Bug 891334
Opened 11 years ago
Closed 11 years ago
PDF File upload : wrong mime type (js)
Categories
(Core Graveyard :: File Handling, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla25
People
(Reporter: dr_fx59, Assigned: poiru)
Details
(Whiteboard: [mentor=jdm][lang=c++][good first bug])
Attachments
(1 file)
1.26 KB,
patch
|
jdm
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release) Build ID: 20130618035212 Steps to reproduce: I am using an input of type file to upload pdf using ajax on Firefox 22.0 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' ! Expected results: The value of file.type should be 'application/pdf'. The same code with the same file works on IE10 and Chrome 28.0.1500.71.
Comment 1•11 years ago
|
||
Yury, any suggestions please ?
Updated•11 years ago
|
Component: Untriaged → File Handling
Product: Firefox → Core
Comment 2•11 years ago
|
||
I think we've got two choices here: if the OS does not appear to be providing us with any good hint, we can add the pdf extension to the list extraMimeEntries list in nsExternalHelperAppService, or we could rely on pdf.js to add a MIME entry for PDFs via the ext-to-type-mapping category. Personally, I think we would want this regardless of the presence of pdf.js.
Comment 3•11 years ago
|
||
Boris, you seem to have reviewed changes to the extraMimeEntries list in the past. Would adding one for PDF make sense here?
Flags: needinfo?(bzbarsky)
Comment 5•11 years ago
|
||
This will be a very simple change for someone to make.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [mentor=jdm][lang=c++][good first bug]
Assignee | ||
Comment 6•11 years ago
|
||
Updated•11 years ago
|
Attachment #777192 -
Flags: review?(josh) → review+
Updated•11 years ago
|
Keywords: checkin-needed
Comment 7•11 years ago
|
||
Thanks!
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/02acc75e4e0c
Keywords: checkin-needed
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/02acc75e4e0c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Reporter | ||
Comment 10•11 years ago
|
||
Thanks !
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•