tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: File Download - CSV question ****
Date Fri, 26 Oct 2001 05:51:57 GMT


On Thu, 25 Oct 2001, Evan Swanson wrote:

> Date: Thu, 25 Oct 2001 13:22:06 -0700
> From: Evan Swanson <Evan.Swanson@gmd.fujitsu.com>
> Reply-To: tomcat-user@jakarta.apache.org
> To: "'tomcat-user@jakarta.apache.org'" <tomcat-user@jakarta.apache.org>
> Cc: 'Dmitri Colebatch' <dim@bigpond.net.au>
> Subject: RE: File Download - CSV question    ****
>
>
> I order to reduce the variable, I tried installing TC4.0 on the same
> windows based machine. I am using the same client for both( IE5.0 ).
>
> Results:
> TC3.2 will present a popup box for downloading files with .CSV extention.
> TC4.0 throws data directly up on the screen.
>

In a servlet 2.3 environment, the default content type is not allowed to
be set on the download.  You must declare it yourself (see below).

>
> Is there any reason for this? Can I change the configuration?
>

Yes.  Yes.

> Is this a MIME type problem?
>

Yes.  You can declare the appropriate content types for your files by
using the <mime-type> declaration like this in your web.xml file:

  <mime-mapping>
    <extension>csv</extension>
    <mime-type>application/octet-stream</mime-type>
  </mime-mapping>

The other important issue is what your *browser* thinks a particular file
type should be.  Netscape Navigator is usually pretty good about
respecting the "Content-Type" header sent by the server, while IE tends to
make its own assumptions about the file type, no matter what yo do on the
server side.


Craig McClanahan



Mime
View raw message