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
I want to check the file mime type to be sure to get a pdf.
var file = uploader.container.find('input[type="file"]').files;
then I check the property 'type' of the file var. (file.type)
The value is 'application/octet-stream' instead of 'application/pdf' !
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.
Yury, any suggestions please ?
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.
Boris, you seem to have reviewed changes to the extraMimeEntries list in the past. Would adding one for PDF make sense here?
I think adding PDF there is totally reasonable.
This will be a very simple change for someone to make.
Created attachment 777192 [details] [diff] [review]
Add default MIME type definition for .pdf as 'application/pdf'