Popup download file over https

  • Thread starter Thread starter Passiday
  • Start date Start date
P

Passiday

Hello,

I am sorry if this is inappropriate here to ask question about the
classic ASP. I am quite sure though that the question is relevant also
to ASP.NET, so I dare to post it here. The classic ASP groups seem to
be quite discontinued...

In my ASP project, I used to use this code for initiating "Save as"
download at the client side:

Response.ContentType = "application/msword";
Response.AddHeader("Content-Disposition", "attachment;
filename=MyReport.doc;");

This code is ran in hidden frame, and had been working very fine.
However, when I switched the project to https, this kind of code now
throws error:

Internet Explorer cannot download ReportDOC.asp from www.domain.com.
Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.

I hope this is not anyhow connected to the client settings. Maybe
there is some header I should add to the response, to make the
download work just like it works over http?

Passiday
 
Hello,

I am sorry if this is inappropriate here to ask question about the
classic ASP. I am quite sure though that the question is relevant also
to ASP.NET, so I dare to post it here. The classic ASP groups seem to
be quite discontinued...

In my ASP project, I used to use this code for initiating "Save as"
download at the client side:

Response.ContentType = "application/msword";
Response.AddHeader("Content-Disposition", "attachment;
filename=MyReport.doc;");

This code is ran in hidden frame, and had been working very fine.
However, when I switched the project to https, this kind of code now
throws error:

Internet Explorer cannot download ReportDOC.asp fromwww.domain.com.
Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.

I hope this is not anyhow connected to the client settings. Maybe
there is some header I should add to the response, to make the
download work just like it works over http?

Passiday

What version of IE do you use? Does it work in Firefox? Is there any
difference if you put it out of frame, or with inline value instead
of attachment? In IE there are few things you may check

http://support.microsoft.com/default.aspx?scid=kb;en-us;300443
http://support.microsoft.com/default.aspx?scid=kb;en-us;321532
 
Hello Alexey,

Thank you for your response.
What version of IE do you use? Does it work in Firefox? Is there any
difference if you put it out of frame, or with inline value instead
of  attachment? In IE there are few things you may check

On Firefox the download behaviour is correct. This really is problem
only on MSIE. Commenting out the attachment header does not fix it.

Unfortunately the two links you mentioned do not apply here. I don't
see any specific security setting that would relate to downloads over
https connections, and also this is not the case when the response is
result of POST request. It's a GET request.

I thought this might have something to do with content expiration, so
I went to check the server settings (IIS website properties, HTTP
Headers, Enable content expiration -- unchecked). But, that seems to
have no relationship with the problem.

I also read that it's bad to do over https things like

response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");

but, I keep getting the same error, also when those lines are
commented out.

I've been reading all over the Internet, but no KB articles helped.
Right now I am writing to my customer (it's an intranet site) --
please consider switching to Firefox, at least until this problem is
resolved. Kind of sad outcome...

Passiday
 
Hello Alexey,

Thank you for your response.


On Firefox the download behaviour is correct. This really is problem
only on MSIE. Commenting out the attachment header does not fix it.

Unfortunately the two links you mentioned do not apply here. I don't
see any specific security setting that would relate to downloads over
https connections, and also this is not the case when the response is
result of POST request. It's a GET request.

I thought this might have something to do with content expiration, so
I went to check the server settings (IIS website properties, HTTP
Headers, Enable content expiration -- unchecked). But, that seems to
have no relationship with the problem.

I also read that it's bad to do over https things like

response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");

but, I keep getting the same error, also when those lines are
commented out.

I've been reading all over the Internet, but no KB articles helped.
Right now I am writing to my customer (it's an intranet site) --
please consider switching to Firefox, at least until this problem is
resolved. Kind of sad outcome...

Passiday

what you can try is to check if ASP.NET returns the same HTTP response
to FF and IE. You can use Fiddler or similar. Maybe there is a
difference, I don't know. I will try to check it as well, not sure
where can I play with https...
 
Back
Top