tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Helmling ...@panix.com>
Subject Re: CSV File
Date Wed, 06 Feb 2002 20:13:43 GMT
On Tue, 2002-02-05 at 18:57, Jason Webber wrote:
> I want the browser to download the file and not display a CSV file that
> I have created.  Right now I issue the following commands, but it
> doesn't seem to work.. Any ideas are appreciated.
> 
> 
> String file;
> ...
> 
> response.setHeader("Content-length","file.length()");
> response.setHeader("Content-type","application/octetstream");
> response.setHeader("Content-disposition","inline;
> filename=\"report.csv\"");
> out.print(file);
> 

Try setting the Content-disposition header to 
"attachment; filename=\"report.csv\"".  You may also need to use an
unknown mime-type to get this to work in all versions of IE.  If it does
not work with "application/octet-stream", try something like 
"application/x-vnd-yourcompany".

Hope this helps.


--g


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message