You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Liu, Xiaoyan" <xl...@CapitalThinking.com> on 2002/05/09 22:51:14 UTC

serving CSV file

Hi, all,

I can seem to make tomcat 4.0.2 serving csv (comma-seperated file)
file. The files are open plain text in IE. I added the following
mime-mapping to web.xml:

<extension>csv</extension>
<mime-type>application/vnd.ms-excel</mime-type>

is there anything else needs to change?

thank you.


Liu

Re: serving CSV file

Posted by Jeff Larsen <la...@qec.com>.
What's your request URL? 

I do it by using a servlet mapping that ends in ".csv"
to fool the browser into thinking it's actually downloading
a file. I set the content-type header to "application/csv" which 
isn't really a universal standard, but if I remember right, the 
mime mapping you listed will make Excel think it's opening a real
.xls spreadsheet and not a text file and it screws things up.

Jeff

----- Original Message ----- 
From: "Liu, Xiaoyan" <xl...@CapitalThinking.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Thursday, May 09, 2002 3:51 PM
Subject: serving CSV file


> Hi, all,
> 
> I can seem to make tomcat 4.0.2 serving csv (comma-seperated file)
> file. The files are open plain text in IE. I added the following
> mime-mapping to web.xml:
> 
> <extension>csv</extension>
> <mime-type>application/vnd.ms-excel</mime-type>
> 
> is there anything else needs to change?
> 
> thank you.
> 
> 
> Liu
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>