tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Excel file in Tomcat Virtual Dir has junk data in it.
Date Thu, 29 Jan 2009 22:38:24 GMT
uddav wrote:
[...]
In the "conf" directory of your Tomcat installation is a file called 
web.xml.
That file contains a section which tells Tomcat about the correspondence 
between file extensions and their "mime type".
Check if it contains a section like this one :
     <mime-mapping>
         <extension>xls</extension>
         <mime-type>application/vnd.ms-excel</mime-type>
     </mime-mapping>

If not, add it, restart Tomcat and retry.

When Tomcat (like other webservers) sends data to a browser, it tells it 
what kind of data this is, via a HTTP header sent along with the data.
The browser should normally accept this information, and handle the 
received data accordingly.

Now, if the browser you are using is Internet Explorer, it is possible 
that even when the webserver tells it what kind of file it is sending 
(like "application/vnd.ms-excel" above), IE in it's wisdom might do its 
own check and decide otherwise.  I would not be surprised if even for an 
Excel file it got it wrong.

In that case, you might want to try the same link with Firefox, just to 
check.
There also exist tools, for IE and Firefox, which allow you to see 
exactly what the server is sending to the browser in terms of 
"description of the file".  If your problem persists, you might want to 
use one of those to find out for sure.
Firefox : LiveHttpHeader add-on
IE : Fiddler2 (search Google)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message