Last Comment Bug 295759 - Firefox asks to save file to disk even if mime-type is text/plain
: Firefox asks to save file to disk even if mime-type is text/plain
Status: RESOLVED INVALID
:
Product: Firefox
Classification: Client Software
Component: File Handling (show other bugs)
: unspecified
: All All
: -- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
http://www.rockbox.org/irc/rockbox-20...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-27 16:02 PDT by Jonas Häggqvist
Modified: 2005-11-22 14:53 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Jonas Häggqvist 2005-05-27 16:02:20 PDT
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 http://www.rockbox.org/irc/rockbox-20050527.txt 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 http://www.rockbox.org/irc/rockbox-20050527.txt
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 OstGote! 2005-05-27 16:59:18 PDT
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).
Comment 2 Matthias Versen [:Matti] 2005-05-27 22:32:17 PDT
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...
Comment 3 Aaron Slunt 2005-05-27 22:36:03 PDT
http://www.rockbox.org/irc/rockbox-20050527.txt

GET /irc/rockbox-20050527.txt HTTP/1.1
Host: www.rockbox.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2)
Gecko/20050523 Firefox/1.0+
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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)?
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2005-05-29 09:15:58 PDT
> 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
http://issues.apache.org/bugzilla/show_bug.cgi?id=13986 and
http://issues.apache.org/bugzilla/show_bug.cgi?id=14095 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).

Note You need to log in before you can comment on or make changes to this bug.