tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beem Rickey L (Rick) CNIN" <bee...@crane.navy.mil>
Subject RE: Additional questions on Tomcat ROOT == Apache Root
Date Tue, 17 Oct 2000 19:24:49 GMT
You have to set the "Content-Disposition" header to "attachment;
filename=YOURFILENAME".

-----Original Message-----
From: Christian Mack [mailto:cmack@spcie.de]
Sent: Tuesday, October 17, 2000 1:45 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Additional questions on Tomcat ROOT == Apache Root



> -----Original Message-----
> From: Daniel Barclay [mailto:Daniel.Barclay@digitalfocus.com]
> Sent: Tuesday, October 17, 2000 8:10 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Additional questions on Tomcat ROOT == Apache Root
> 
> 
> Drew Kidder wrote:
> > 
> > I have a slight problem with my servlet, which may be 
> related to this. See
> > if this is a result of a goofy ROOT setup...
> > 
> > The user clicks on a link looking like
> > http://host/myservlet?name="myfile.pdf", where the "name" 
> parameter is the
> > name of the file that they want to download. However, when 
> the file is sent
> > back to the browser/plugin app, the filename is not 
> "myfile.pdf", but
> > "myservlet.pdf". The file contents are correct in every 
> way, but the naming
> > is off. I was able to fix it by setting the Location header in the
> > response, but that munged up another feature of the servlet 
> (which I posed
> > questions on here) by doing a redirect.
> > 
> > Is this behavior based on the fact that my servlet may not 
> be set up right
> > as far as the context and/or root is concerned?
> 
> You probably need to set the intended file name in the right 
> place.  There's
> a parameter named something like "disposition" in one of the 
> HTTP/MIME headers.
> Look in the MIME or HTTP specs. (the RFCs).
> 
> 
> Daniel
> -- 
> Daniel Barclay
> Digital Focus
> Daniel.Barclay@digitalfocus.com

Hi

The correct header name is "Content-Disposition" (RFC2183).
The syntax is like this:
Content-Disposition: attachment; filename="whatever_filename_you_want.txt"


Tschau
Christian

Mime
View raw message