You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim Sodergren <ts...@terratek.com> on 2005/04/19 18:23:44 UTC

Plain text mime-mapping and IE

Hello Group,

First time user.

I am using Tomcat 4.1.30 to serve (among other things) plain text files with
.dat and .las extensions. I have added the following lines to the
conf/web.xml file:

    <mime-mapping>
        <extension>las</extension>
        <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>dat</extension>
        <mime-type>text/plain</mime-type>
    </mime-mapping>

And they display properly in Netscape or Firefox. When trying to view in IE,
however it doesn't recognize the file type and prompts the user to open or
save. If the user selects open whatever text editor IE chooses can't find
the file. Save works properly. Does IE's mime-sniffer completely ignore my
server settings? Is there a workaround for this (without having to change
all of my files and links to .txt)?

Thanks in advance.

-Tim

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.17 - Release Date: 4/19/2005
 


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


Re: Plain text mime-mapping and IE

Posted by QM <qm...@brandxdev.net>.
On Tue, Apr 19, 2005 at 03:18:22PM -0600, Tim Sodergren wrote:
: I've never done filters before. I know how to do the filter-mapping from
: web.xml and know Java programming but not how to make filters for Tomcat.
: Could you point me in the right direction? 

Sure -- it may be confusing because filters aren't part of Tomcat;
they're part of the Servlet Spec (which Tomcat implements).  

Search the web for "servlet filter" or just check out the Servlet Spec
(available from Sun.com) for details.

-QM

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


RE: Plain text mime-mapping and IE

Posted by Tim Sodergren <ts...@terratek.com>.
I've never done filters before. I know how to do the filter-mapping from
web.xml and know Java programming but not how to make filters for Tomcat.
Could you point me in the right direction? 

-----Original Message-----
From: Trond G. Ziarkowski [mailto:trond.ziarkowski@gep-as.com] 
Sent: Tuesday, April 19, 2005 2:36 PM
To: Tomcat Users List
Subject: Re: Plain text mime-mapping and IE

Hi Tim,

try serving the file through a servlet or jsp, or use a filter mapped to
*.las and *.dat, and use response.setHeader("Content-Disposition",
"inline; filename=file.txt"), and response.setContentType("text/plain").

Works for me...

Trond

Tim Sodergren wrote:

>Hello Group,
>
>First time user.
>
>I am using Tomcat 4.1.30 to serve (among other things) plain text files 
>with .dat and .las extensions. I have added the following lines to the 
>conf/web.xml file:
>
>    <mime-mapping>
>        <extension>las</extension>
>        <mime-type>text/plain</mime-type>
>    </mime-mapping>
>    <mime-mapping>
>        <extension>dat</extension>
>        <mime-type>text/plain</mime-type>
>    </mime-mapping>
>
>And they display properly in Netscape or Firefox. When trying to view 
>in IE, however it doesn't recognize the file type and prompts the user 
>to open or save. If the user selects open whatever text editor IE 
>chooses can't find the file. Save works properly. Does IE's 
>mime-sniffer completely ignore my server settings? Is there a 
>workaround for this (without having to change all of my files and links to
.txt)?
>
>Thanks in advance.
>
>-Tim
>
>  
>


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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.17 - Release Date: 4/19/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.17 - Release Date: 4/19/2005
 


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


Re: Plain text mime-mapping and IE

Posted by "Trond G. Ziarkowski" <tr...@gep-as.com>.
Hi Tim,

try serving the file through a servlet or jsp, or use a filter mapped to 
*.las and *.dat, and use response.setHeader("Content-Disposition", 
"inline; filename=file.txt"), and response.setContentType("text/plain").

Works for me...

Trond

Tim Sodergren wrote:

>Hello Group,
>
>First time user.
>
>I am using Tomcat 4.1.30 to serve (among other things) plain text files with
>.dat and .las extensions. I have added the following lines to the
>conf/web.xml file:
>
>    <mime-mapping>
>        <extension>las</extension>
>        <mime-type>text/plain</mime-type>
>    </mime-mapping>
>    <mime-mapping>
>        <extension>dat</extension>
>        <mime-type>text/plain</mime-type>
>    </mime-mapping>
>
>And they display properly in Netscape or Firefox. When trying to view in IE,
>however it doesn't recognize the file type and prompts the user to open or
>save. If the user selects open whatever text editor IE chooses can't find
>the file. Save works properly. Does IE's mime-sniffer completely ignore my
>server settings? Is there a workaround for this (without having to change
>all of my files and links to .txt)?
>
>Thanks in advance.
>
>-Tim
>
>  
>


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