Images with non-ascii characters in file name uploaded as application/octet-stream.




11 years ago
8 years ago


(Reporter: billythekid, Unassigned)


Firefox Tracking Flags

(Not tracked)


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



11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9) Gecko/2008052912 Firefox/3.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9) Gecko/2008052912 Firefox/3.0

When an image is selected in a file upload form and posted to the server, any valid JPG or GIF image will be sent as application/octet-stream instead of the proper mime-time if the image file name contains non-ascii chars.  If the very same image is re-named to exclude all non-ascii chars, the mime-type is correctly reported. 

Reproducible: Always

Steps to Reproduce:
1. Upload a valid GIF or JPG image named "test.gif" or "test.jpg" to a server
2. On the server, observe the mime type of the content
3. Re-name the file on the local computer to include a non-ascii character like: ā, ö or ц.
4. Re-upload the image to the server using an HTML file upload form input widget
5. Observe the mime-type of this re-named image
Actual Results:  
The mime-type is reported as: application/octet-stream. 

Expected Results:  
The mime-type should be: image/jpeg or image/gif

This causes problems for image upload services that filter the uploaded content based on the mime-type and disallow anything that is not an image/*.

Comment 1

11 years ago
I don't know wether this bug is the same as this one on windows.
If a file is declared as attachment of an octet-stream document, if the file name of the attachement includes blanks (spaces), the attachment itself is view as a octet-stream and not as a file type depending on its extension.
for exemple :if in the HTTP Header the two properties are as follow :
Content-type: application/octet-stream
content-disposition: attachment; filename=gpg - manual.pdf
the name of the file includes blank(s) (here gpg - manual.pdf)
the file is not view as a pdf document and firefox prompts for "open with + EXPLORE" or
"save as".

Unlike this, if the file name doesn't contain blank like "gpg-manual.pdf"
firefox prompts (according to user options) for "open with + ADOBE READER" or
"save as". It's OK.
Here is the content of the HTTP Header :

HTTP/1.x 200 OK
Cache-Control: private
Content-Length: 176140
Content-Type: application/octet-stream
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=gpg - manual.pdf
Date: Fri, 04 Jul 2008 14:04:52 GMT
This bug was reported using Firefox 3.0 or older, which is no longer supported. The bug has also not been changed in over 500 days and is still in UNCO.
Reporter, please retest this bug in Firefox 3.6.10 or later using a fresh profile, If you still see this problem, please update the bug. If you no longer see the bug, please set the resolution to RESOLVED, WORKSFORME.

This is a mass search of unconfirmed bugs that have no activity on them, so if you feel a bug was marked in error, just remove the CLOSEME comment in the whiteboard within the next month.
Whiteboard: [CLOSEME 2010-11-15]
No reply, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile ( If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Last Resolved: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.