Problem loading in IE

I am using classic asp with vb script. Code to download excel file:

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=ExportedData.xls"
Response.Write "<table><tr><td>1</td></tr></table>"

Then it works fine with firefox or any other bootloader similar to an orbital bootloader. But I get an error in IE 6.0 / 7.0 / 8.0.

Message:

Internet Explorer cannot download myasppage.asp from secure.siteurl.com.

Internet Explorer was unable to open this website. The requested site is either unavailable or cannot be found. Please try again later.

so what will be the problem?

FYI: I pass the query string parameter ysnDownload = 1 to the myasppage.asp page. & Amp; if it is passed then, and only then it will have a ContentType as another application, it will have a default type (text / html).

+3
4

, "secure.siteurl.com". , https?

"" , IE . , . , https , , . .

Expires CacheControl Response, . : -

Response.Expires = 1
Response.CacheControl = "private; max-age=10"
+2

SSL (secure.siteurl.com SSL ?), Internet Explorer .

, , :

Cache-Control: public, must-revalidate
Pragma: hack
0

Are you clearing and ending?

Response.Clear
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=ExportedData.xls"
Response.Write "<table><tr><td>1</td></tr></table>"
Response.End
0
source

http://forums.asp.net/t/1224596.aspx

This line of code should work for you, just clear the headers before exporting the file. Reponse.ClearHeaders ();

0
source

Source: https://habr.com/ru/post/1724736/


All Articles