views:

171

answers:

2

I have an ASP.NET web application the entire site is browsed over HTTPS using a valid commercial certificate. In one part of the application it is possible to download an Excel spreadsheet. The download is initiated from a POST (PostBack from a LinkButton)

The Response is cleared (Response.Clear(), Response.BinaryWrite(bytes[])) blah etc.. like we've done in a thousand projects that all work fine, Correct content headers are set and everything. the only difference here is SSL but I can't see how that's related. Yes there are loads of links about cache headers that prevent IE puting the file to temporary internet files so then the relevant office program can be launched to open it etc etc yadda... I've read all those. I have verified the cache headers with fiddler and LiveHeaders(FF Extension) and can confirm "Cache: private;" is what's being sent in the response from both the production site and my local dev set-up.

If I set up an SSL certificate on my local IIS instance and run the project I can open or save the exact same spreadsheet with no problems using IE ( I know there's nothing wrong with the live production file cos FireFox downloads it no sweat, what a surprise!) However, from the production web-server IE6 says the remote host disconected and IE7 just sits there downloading till the end of time (real helpful!) Gah i'm tearing me hair out

A: 

Have you tried the Content Disposition MIME header?

Daniel A. White
Yes I am using exactly that
HollyStyles
+1  A: 

SSL, attachments and IE are a horrible mix. This is a known bug (some call it a "feature") with IE and certain HTTP headers over SSL. Basically, if the browser is told not to store the file what happens is that it is basically deleted before it's served to the user. You actually want to allow them to cache it.

Here is a Microsoft support article about it. And another.

cletus
I agree in my bones i feel it's IE's handling of the response I have read both those articles. But, both the dev and prod servers are sending the same Cache header and on dev it works but in prod no go.
HollyStyles
I think I have to accept there is no correct answer to this question as it depends on a lot of environment variables. Accepting this answer as it has the most relevant links.
HollyStyles