You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Wall <d....@computer.org> on 2004/11/15 19:23:22 UTC

Content-disposition for file downlaod with Mozilla/Firefox

The following are headers we send out for a given file that is being
downloaded:

Content-Length: 28160
content-disposition: attachment;filename=Some Agreement 2004-11-15.doc
Content-Type: application/octet-stream

I believe this used to work fine with Mozilla in an earlier version.  I'm
running Mozilla 1.7.3 and Firefox 1.0, but it doesn't work on them.   It
works just fine on Opera 7.11, IE 6, and Netscape 7.1.

On Mozilla/Firefox, it is stopping at the space in the header, so it thinks
the filename is just "Some" rather "Some Agreement 2004-11-15.doc".  My
impression is that HTTP headers are allowed to contain spaces and it's only
a newline that should end the value of a header.  Is this something I need
to concern myself with from the web application side, or is this just a bug
with Mozilla/Firefox?

Thanks,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Content-disposition for file downlaod with Mozilla/Firefox

Posted by Shankar Unni <sh...@netscape.net>.
David Wall wrote:

> Content-Disposition: attachment;filename="Some Agreement 2004-11-15.doc"

This is the correct fix: format the header as per RFC 2231.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Content-disposition for file downlaod with Mozilla/Firefox

Posted by David Wall <d....@computer.org>.
Most interesting!  I've given it a shot (just putting quotes around the
filename) and it does seem to fix things for all the browsers I test with
(Mozilla 1.7, Firefox 1.0, Netscape 7.1, IE 6 and Opera 7.11).

I was worried it was a browser thing, but it does appear to be something I
can fix in my servlet.  It is interesting that so many browsers have "fixed"
broken standards to make things appear to work that you get fat on such
simple errors.  After all, it was surprising that Netscape 7.1 worked fine
since it's Mozilla based, and because it worked with IE and Opera, too, it
surely seemed to be a Mozilla bug.

So I now use something like:

Content-Disposition: attachment;filename="Some Agreement 2004-11-15.doc"

Thanks again,
David

----- Original Message ----- 
From: "Tim Funk" <fu...@joedog.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, November 15, 2004 3:54 PM
Subject: Re: Content-disposition for file downlaod with Mozilla/Firefox


> Its not a bug.
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=221028
>
> -Tim
>
> David Wall wrote:
> > The following are headers we send out for a given file that is being
> > downloaded:
> >
> > Content-Length: 28160
> > Content-Disposition: attachment;filename=Some Agreement 2004-11-15.doc
> > Content-Type: application/octet-stream
> >
> > I believe this used to work fine with Mozilla in an earlier version.
I'm
> > running Mozilla 1.7.3 and Firefox 1.0, but it doesn't work on them.   It
> > works just fine on Opera 7.11, IE 6, and Netscape 7.1.
> >
> > On Mozilla/Firefox, it is stopping at the space in the header, so it
thinks
> > the filename is just "Some" rather "Some Agreement 2004-11-15.doc".  My
> > impression is that HTTP headers are allowed to contain spaces and it's
only
> > a newline that should end the value of a header.  Is this something I
need
> > to concern myself with from the web application side, or is this just a
bug
> > with Mozilla/Firefox?
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Content-disposition for file downlaod with Mozilla/Firefox

Posted by Tim Funk <fu...@joedog.org>.
Its not a bug.

https://bugzilla.mozilla.org/show_bug.cgi?id=221028

-Tim

David Wall wrote:
> The following are headers we send out for a given file that is being
> downloaded:
> 
> Content-Length: 28160
> content-disposition: attachment;filename=Some Agreement 2004-11-15.doc
> Content-Type: application/octet-stream
> 
> I believe this used to work fine with Mozilla in an earlier version.  I'm
> running Mozilla 1.7.3 and Firefox 1.0, but it doesn't work on them.   It
> works just fine on Opera 7.11, IE 6, and Netscape 7.1.
> 
> On Mozilla/Firefox, it is stopping at the space in the header, so it thinks
> the filename is just "Some" rather "Some Agreement 2004-11-15.doc".  My
> impression is that HTTP headers are allowed to contain spaces and it's only
> a newline that should end the value of a header.  Is this something I need
> to concern myself with from the web application side, or is this just a bug
> with Mozilla/Firefox?
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org