Closed Bug 263933 Opened 20 years ago Closed 13 years ago

Fails to find filename param in out-of-order content-disposition header (filename=foo; attachment)

Categories

(Core :: Networking, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED WONTFIX

People

(Reporter: volatilevoid, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1

Whenever I download a driver, the DM uses "getfile.asp" as filename instead
right filename. I tried it with Internet Explorer, there it works.


Reproducible: Always
Steps to Reproduce:
1. Left side: DOWNLOADS
2. Select a subcategory and then a driver.
3. Click on a filename on the right side.

Actual Results:  
The Download Manager shows "getfile.asp" as filename. File type is displayed
correctly (zip for the zip file).

Expected Results:  
It should be saved under the name displayed on the page, e. g.
"3x12A_linux_rdvr-1.0.0.16-BUNDLE.zip" (this is the driver I tried).


Standard Firefox 1.0 PR
Returned header: 

content-disposition: filename=3x12_x86_rdvr-logod-10051.zip; attachment

RFC 2183:

Content-Disposition: attachment; filename=3x12_x86_rdvr-logod-10051.zip

-> TE?
This happens with various other servers and scripts, too. e.g. downloads via
download.pl from http://www.online-predigt.de.
Right Click on the link, "Save Link as..." produces Save-As-Box with suggested
filename download.pl instead of xyz.mp3.
Instead copying the link to clipboard and inserting link into Location Bar,
choosing "Save as" in the following dialog brings up Save-As-Dialog with correct
suggested filename.
Example Link:
http://www.online-predigt.de/cgi-bin/download.pl?file=derek_prince_biblische_grundlagen_fuer_ehemaenner_und_vaeter_teil1.mp3

I have had this same problem, but narrowed it down to when there is a space in
the filename, firefox cuts off everything after the space and saves as what was
before the first space.  An example of the header is below. Spaces have been
replaced by "·" and line breaks have been replaced.  The file below would be
saved as "XcClassified" with no extention.

HTTP/1.1·200·OK(CR)
(LF)
Server:·Microsoft-IIS/5.0(CR)
(LF)
Date:·Tue,·30·Nov·2004·17:21:27·GMT(CR)
(LF)
content-disposition:·attachment;·filename=XcClassified·v3.x·Administrators·Guide.pdf(CR)
(LF)
Connection:·Keep-Alive(CR)
(LF)
Content-Length:·2340080(CR)
(LF)
Content-Type:·text/html(CR)
(LF)
Set-Cookie:·ASPSESSIONIDQSCARQDA=BEIGDCEDFPKKNMOEJHEEDDII;·path=/(CR)
(LF)
Cache-control:·private(CR)
(LF)
(CR)
(LF)
bugzilla@dblood.matraex.com: you've got the wrong bug. yours happens to be
invalid. the rfc requires quoting spaces.
So the problem is that the algorithm in
nsMIMEHeaderParamImpl::GetParameterInternal looks for a parameter after the
first ';' character (per spec).  In the special case that there is no ';'
character at all (broken server, common case), it starts looking at the
beginning of the string.

But in this case there _is_ a ';' in the header.  So I think our behavior is
correct (anything else would be a gross violation of the spec)....

Over to core networking, but I suspect this is tech evang. I'd like to hear
Jungshik's thoughts first.
Assignee: bugs → darin
Component: Download Manager → Networking
Product: Firefox → Core
QA Contact: bmo → benc
Version: unspecified → Trunk
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug is waiting on module owner feedback.  It should be in the READY state.
Bug is still there... Firefox 1.0.7
Assignee: darin → nobody
QA Contact: benc → networking
Resummarizing since I keep running across this and wondering what on earth it was.
Summary: Wrong filename in Download Manager when downloading through an .asp → Fails to find filename param in out-of-order content-disposition header (filename=foo; attachment)
(In reply to comment #5)
> So the problem is that the algorithm in
> nsMIMEHeaderParamImpl::GetParameterInternal looks for a parameter after the
> first ';' character (per spec).  In the special case that there is no ';'
> character at all (broken server, common case), it starts looking at the
> beginning of the string.
> 
> But in this case there _is_ a ';' in the header.  So I think our behavior is
> correct (anything else would be a gross violation of the spec)....
> ...

I agree that the behavior is correct. It's one of these situations were the client has a workaround for one class of problems (missing disposition), but not another class (filename parameter and disposition reversed).

Optimally, reduce the number of workarounds, not add to them.
Test case: <http://greenbytes.de/tech/tc2231/#attreversed>

It appears that no browser other than IE has this workaround, and even Microsoft fixed it in IE9 (maybe not intentionally, but that doesn't really matter :-)
OK.  I'm going to wontfix this, then.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.