R
Radek
How to disable IE mime sniffing for all files?
Regards
Radek
Regards
Radek
must when asking for help in the newsgroups, but, try the following and
see
if it helps:
IE>Tools>Internet Options>Security>click Custom level>Miscellaneous
section:
Scroll down in this section and check Enable under "Open files based on
content, not file extension"
[...]
Pdf file it is an example of file.
Look here: http://blogs.msdn.com/ie/archive/2005/02/01/364581.aspx
IE>>> Tools>Internet Options>Security>click Custom level>MiscellaneousIt is Windows XP SP2 and IE6
This nor work ;-(
If I try download file from URL download.asp?filename=file.pdf
IE rename pdf file into download.asp file ;-(
I think that the problem is with IE (on server side is everythings ok)
and his mime/extensions sniffing.
page you have control over, are you setting the Content-Disposition header
to pass the filename? If not, IE will use the ASP page name as that is the
filename in the request.
In ASP page I use:
Response.clear
Response.AddHeader "Content-Disposition", "Attachment: filename=" &
FileNameFormDatabase
Response.ContentType = ContentTypeFromDatabase
Response.binarywrite BinDataFromDatabase
Response.flush
It seems to that this page is proper.
For PDF file:
FileNameFormDatabase = file.pdf
ContentTypeFromDatabase = application/pdf
for XLS file:
FileNameFormDatabase = file.xls
ContentTypeFromDatabase = application/vnd.ms-excel
Simple page but IE always use the page name for file name.
If I use ContentTypeFromDatabase = application/download IE
renames files to the ASP page name. If I use ContentTypeFromDatabase
from my database extension is ok but the file neme is like ASP page.