The default bug view has changed. See this FAQ.

Firefox asks to save file to disk even if mime-type is text/plain




File Handling
12 years ago
12 years ago


(Reporter: Jonas Häggqvist, Unassigned)


Firefox Tracking Flags

(Not tracked)





12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Opening the url pops up Firefox'
download-dialog even though the webserving is specifying the mimetype
text/plain. The file includes 6 non-printable characters, but I don't believe
this warrants ignoring the mimetype specified by the server.

Reproducible: Always

Steps to Reproduce:
1. Open url
2. That's it
3. There is no 3.
Actual Results:  
Firefox opens its "Save or open with" dialog.

Expected Results:  
Display the file-contents as text/plain as the server specified.

Comment 1

12 years ago
Same for Moz 1.7.8. I guess this is because the txt file contains some special
characters (non-printable) and the parser decides not to display it (thinks this
is some of the binary file types which are sent wrongly with plain/text).
Mozilla auto-sniffing decided that this can't be text. You can see that at the
text of the save as dialog in recent Mozilla trunk builds.

I think this is an edge case and will probably not fixed but confirming because
the developers must decide what to do with this bug report...
Ever confirmed: true

Comment 3

12 years ago

GET /irc/rockbox-20050527.txt HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2)
Gecko/20050523 Firefox/1.0+
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Range: bytes=45260-
If-Range: "1eb186-125d2-a559d580"

HTTP/1.x 206 Partial Content
Date: Sat, 28 May 2005 05:35:05 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-12
Last-Modified: Fri, 27 May 2005 21:59:02 GMT
Etag: "1eb186-125d2-a559d580"
Accept-Ranges: bytes
Content-Length: 29958
Content-Range: bytes 45260-75217/75218
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/plain; charset=iso-8859-1

Could firefox be leaving it up to the user what to do since it believes that the
page is possibly corrupted (partial content)?
> Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-12

This is a known-buggy server that sends "text/plain; charset=iso-8859-1" for any
content it doesn't recognize.  We've been forced to work around such servers
after asking them for years to fix the bug.  See and for the discussion on
the Apache bugs.

Note, further, that sending the document in question as text/plain is in fact a
violation of the RFC that defines the text/plain MIME type, since the file
_does_ include said unprintable characters (which text/plain files are not
allowed to do).
Last Resolved: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.