tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attila Szegedi" <szege...@freemail.hu>
Subject Re: CSV File
Date Thu, 07 Feb 2002 07:51:36 GMT
IE ignores the Content-Type and makes a guess on content type based on the
content itself. If it recognizes a plain text content, it will display it as
such no matter what the Content-Type. However, Content-Disposition should
help.

Attila.

----- Original Message -----
From: "Gary Helmling" <gh@panix.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: 2002. február 6. 21:13
Subject: Re: CSV File


> 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>
>
>


--
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