By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,020 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,020 IT Pros & Developers. It's quick & easy.

Very Weird IE Content-Disposition issues

P: n/a
I have a aspx page that creates a binary file and response.binarywrites
it to the browser. To force the file to be saved or opened I use the
"Content-Disposition" header.

All works fine in Firefox but I have some strange issues with IE where
I get the error:

"Internet Explorer was not able to open the Internet Site"

from the "file download" dialog box, but before Im given the choice to
open or download.

The strange bit is that exactly the same code works fine with IE
locally, but not once I put it live

Also if I type the URL directly into IE it never works, but it I follow
a normal <a hrefin an html page to the url it works fine

Ive played with lots of suggestions with caching as you can see from
the commented out sections in the code below but none seem to work.

Any ideas?


Response.AddHeader("Content-Disposition", "attachment;
//Response.AddHeader("Cache-Control", "no-store, no-cache,
no-transform, must-revalidate, private");
//Response.AddHeader("Expires", "0");
Response.AddHeader("pragma", "no-cache");
Response.ExpiresAbsolute = new DateTime(1900,1,1);
byte[] kmz = geUtils.Document.ToKmz();
Response.AddHeader("Content-Length", kmz.Length.ToString());

Response.ContentType = "application/;";
Response.Charset = "utf8";



Aug 6 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Forgot to mention, this is not using SSL

Aug 7 '06 #2

P: n/a
OK found the fix

Just add Response.ClearHeaders();

then works fine it IE??

Brian Norman

Aug 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.