Tomcat Filter Not Retro Active

2006-10-05 Thread Threepwood

I am using a filter to set the content type and header to to force
downloading of linked files, so that they open with their registered app
instead of within IE. I am doing this with the following code: 

response.setContentType(application/octet-stream); 
response.setHeader(Content-Disposition,attachment; filename= +
fileName); 

It is working great for files uploaded to the server after the changes. But
files uploaded before the changes are still either opening in the web
browser using the apps plugin or displaying directly in the web browser
usually as jumbled binary. 
I was wondering why this is happening? I thought the filter was to apply at
run time, so when the file is being downloaded, and thus should open as the
newly upload files do. Thanks for the help. 

Joe
-- 
View this message in context: 
http://www.nabble.com/Tomcat-Filter-Not-Retro-Active-tf2391606.html#a6667835
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Filter Not Retro Active

2006-10-05 Thread Len Popp

Could it be that the old files are already cached by the browser? Try
clearing the browser's cache, and put some logging in your filter so
you can see if the filter is actually executed when you request a
file.
--
Len


On 10/5/06, Threepwood [EMAIL PROTECTED] wrote:


I am using a filter to set the content type and header to to force
downloading of linked files, so that they open with their registered app
instead of within IE. I am doing this with the following code:

response.setContentType(application/octet-stream);
response.setHeader(Content-Disposition,attachment; filename= +
fileName);

It is working great for files uploaded to the server after the changes. But
files uploaded before the changes are still either opening in the web
browser using the apps plugin or displaying directly in the web browser
usually as jumbled binary.
I was wondering why this is happening? I thought the filter was to apply at
run time, so when the file is being downloaded, and thus should open as the
newly upload files do. Thanks for the help.

Joe
--
View this message in context: 
http://www.nabble.com/Tomcat-Filter-Not-Retro-Active-tf2391606.html#a6667835
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Filter Not Retro Active

2006-10-05 Thread Threepwood

Thanks mate, appears that it was a browser caching issue.

Joe


Len Popp wrote:
 
 Could it be that the old files are already cached by the browser? Try
 clearing the browser's cache, and put some logging in your filter so
 you can see if the filter is actually executed when you request a
 file.
 -- 
 Len
 
 
 On 10/5/06, Threepwood [EMAIL PROTECTED] wrote:

 I am using a filter to set the content type and header to to force
 downloading of linked files, so that they open with their registered app
 instead of within IE. I am doing this with the following code:

 response.setContentType(application/octet-stream);
 response.setHeader(Content-Disposition,attachment; filename= +
 fileName);

 It is working great for files uploaded to the server after the changes.
 But
 files uploaded before the changes are still either opening in the web
 browser using the apps plugin or displaying directly in the web browser
 usually as jumbled binary.
 I was wondering why this is happening? I thought the filter was to apply
 at
 run time, so when the file is being downloaded, and thus should open as
 the
 newly upload files do. Thanks for the help.

 Joe
 --
 View this message in context:
 http://www.nabble.com/Tomcat-Filter-Not-Retro-Active-tf2391606.html#a6667835
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-Filter-Not-Retro-Active-tf2391606.html#a6669356
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Filter Not Retro Active

2006-10-05 Thread Christopher Schultz
Joe,

 Thanks mate, appears that it was a browser caching issue.

Whoops ;)

Also, please note that MSIE is a steaming pile of dung when it comes to
content-type headers.

http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html

and more importantly:

http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.asp

Quick recap:

MSIE always ignores your content-type and tries to guess what it is
based upon the content. (See step #2 in the MSDN article).

-chris



signature.asc
Description: OpenPGP digital signature