How to disable mime sniffing

J

Jan Il

Hi Radek :)

You don't mention the version of Windows you are using, which really is a
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"

Hope this helps.

Jan :)
MS MVP - Windows IE/OE [DTS/AumHa]
Smiles are meant to be shared,
that's why they're so contagious.

Replies are posted only to the newsgroup for the benefit or other readers.
How to make a good newsgroup post:
http://www.dts-l.org/goodpost.htm
 
R

Radek

You don't mention the version of Windows you are using, which really is a
must when asking for help in the newsgroups, but, try the following and
see
if it helps:

It is Windows XP SP2 and IE6
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"

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.

Regards,
Radek
 
J

Jan Il

Hi Radek :)

Ok...let's try another direction. It may not be the mime sniffing.

Clear your cache:
Tools > Internet Options> click Delete Files, and see if it's reproducible.

Open Windows Explorer ( not IE)
Find and select any PDF file and right click on it and click on Open with...
If the program you use to read the PDF's in not there, then close the box
With the PDF file still highlighted:
Go to Tools> Folder Options-File Types
Scroll down the list until you find the program that should open the PDF and
click it
then click the Change button, scroll down the list to the program you need
and click on it, then click OK and close out. Then try the PDF again.

also...

Try uninstalling and then reinstalling the Acrobat Reader: If sitll no joy,
then get the latest update.
http://www.adobe.com/prodindex/acrobat/readstep.html

Hope this helps.

Jan :)
MS MVP - Windows IE/OE [DTS/AumHa]
Smiles are meant to be shared,
that's why they're so contagious.

Replies are posted only to the newsgroup for the benefit or other readers.
How to make a good newsgroup post:
http://www.dts-l.org/goodpost.htm
 
J

Jan Il

Hi Radek :)

">> Ok...let's try another direction. It may not be the mime sniffing.
[...]

Pdf file it is an example of file.
Look here: http://blogs.msdn.com/ie/archive/2005/02/01/364581.aspx

Yes...I know....but, if the disabling of the MIME does not resolve the
problem, it may be from another cause. I don't know of any other
suggestions in how to disable or block the MIME sniffing, but, perhaps
someone else here has a better solution for you. :)

Good luck!

Jan :)
MS MVP - Windows IE/OE [DTS/AumHa]
Smiles are meant to be shared,
that's why they're so contagious.
 
D

Daniel Crichton

Radek wrote on Mon, 6 Mar 2006 13:34:24 +0100:
It is Windows XP SP2 and IE6
IE>>> Tools>Internet Options>Security>click Custom level>Miscellaneous
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.

How do you know everything on the server side is OK? If this is an ASP 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.

Dan
 
R

Radek

How do you know everything on the server side is OK? If this is an ASP
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.

Regards,
Radek
 
D

Daniel Crichton

Radek wrote on Mon, 6 Mar 2006 17:58:15 +0100:
In ASP page I use:

Response.clear
Response.AddHeader "Content-Disposition", "Attachment: filename=" &
FileNameFormDatabase

Is that a typo, or are you really using a colon :)) between Attachment and
filename? It's supposed to be a semi-colon (;).

Response.AddHeader "Content-Disposition","attachment; filename=" &
FileNameFromDatabase

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.

I don't think application/download is a supported IE MIME type. It should be
application/x-download to force a Save As dialog.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top