Closed Bug 326821 Opened 19 years ago Closed 14 years ago

Mimetype output wrong on upload via php($_FILES -file_type) with FF 1.5.0.1

Categories

(Firefox :: General, defect)

1.5.0.x Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: webmaster, Unassigned)

References

Details

(Whiteboard: [CLOSEME 5-15-2010])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

I have restricted uploads to *.pdf,*.zip,*.rar in a simple php upload-function.
With FF 1.5.0.1 (german) i can´t upload pdf + zipfiles because my script checks for the correct mimetype. Firefox give wrong mimetypes for zip and pdf !
The results are from the global php var $_FILES['upload']['upload_type'].


Reproducible: Always

Steps to Reproduce:
1.Try to upload a pdf or zipfile with a simple php upload script
2.Display the contents of $_FILES with ' print_r($_FILES); '
3.The output shows you under [type] => the mimetype.

Actual Results:  
If a pdf is uploadfile, 'application/octetstream' is returned 
If upload is a zipfile, FF returned 'application/force-download'.

Expected Results:  
Pdf´s should return 'application/pdf'.
Zipfiles should return 'application/x-zip-compressed' or 'application/zip'.

Internet Explorer returns- zip: application/x-zip-compressed, pdf: application/pdf
Opera returns- zip: application/zip, pdf: application/pdf

These are the correct and expected mimetypes.
Dupe of/related to bug 316143 and/or bug 279619?
Yeah, a bit related to bug 316143, adds wrong zip mimetype.
Additional: With FF 1.07 all uploads went fine. Will check some other mimetypes soon and post results, if any differences to normal behaviour sighted.
Popular filetypes and the mimetypes that major browsers return on WinXP:
ff= firefox 1.5.0.1ge ie=Iexplore6(XP)  op=opera 8.0
-----------------------------------
Exe - M$ executable
ff - application/x-msdownload 
ie - application/octet-stream
op - application/x-msdownload

Jpg - image
ff - image/jpeg
ie - image/pjpeg
op - image/jpeg

Png - image
ff png - image/png
ie png - image/x-png
op png - image/png

Odt - OpenOffice Document
ff - application/vnd.oasis.opendocument.text
ie - application/x-zip-compressed
op - application/octet-stream

Tgz - compressed archive
ff - application/x-gtar
ie - application/x-gzip-compressed
op - application/x-gzip

Rpm - redhat archive
ff - audio/x-pn-realaudio-plugin
ie - application/octet-stream
op - audio/x-pn-realaudio-plugin

I suggest using:
zip - application/zip
pdf - application/pdf
Rpm.. better to set this as M$Ie does? 
rpm - application/octet-stream
Same problem happens for Microsoft Excel - Content-Type: text/ms-excel-file. Only Windows Firefox 1.5 is affected. Problem didn't exist in Win Firefox 1.0.

XLS - Microsoft Excel
ff 1.5 Win - text/ms-excel-file
ff 1.5 Linux - application/vnd.ms-excel
ff 1.5 Mac - application/octet-stream
ff 1.0 Win - application/octet-stream
ie - application/octet-stream
op 8.5 Win - application/vnd.ms-excel
safari 1.3 - application/vnd.ms-excel
suggested - application/octet-stream (per MS's own choice in IE)

(tested on Windows XP, MacOs 10.3.9, Linux Ubuntu 6.0.6)

Other popular Office files (word, powerpoint) are OK.
Are these all dupes of each other? Or perhaps related to another meta-bug?


Bug 373621 – File upload set mime type as application/download instead of application/pdf (edit)
Bug 323462 – Sent pdf file is damaged, if sent in IE it is fine using yahoo mail (edit)
Bug 336212 – Firefox won't upload pdf files from academic medical journal websites. IE will upload pdf immediately (edit)
Bug 326821 – Mimetype output wrong on upload via php($_FILES -file_type) with FF 1.5.0.1 (edit)
To all problem reporters:
Please read Bug 373621 Comment #5 and check mimeTypes.rdf content.
Is there multiple definitions or unexpected definition for ".pdf"?  
Mime Type for PDF files returned by firefox is "application/octetstream" instead of "application/octet-stream" or "application/pdf"
This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 5-15-2010]
Version: unspecified → 1.5.0.x Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.3 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.