IE : Unable to download * from *. Unable to open this Internet site. The requested site is either unavailable or cannot be found

后端 未结 13 773
别跟我提以往
别跟我提以往 2020-11-29 22:03

I have an issue with my website and IE. I have a file Document.ashx that becomes a document from my database depending on the parameter passed in the query

相关标签:
13条回答
  • 2020-11-29 22:40

    dynamic create Iframe ,set the src to the download page loaction , append to the body.

    function downloadInIFrame(fileId) { var url = "download.aspx?fileId=" + fileId; var iframe = document.createElement("iframe"); iframe.src = url; iframe.style.display = "none"; document.body.appendChild(iframe); }

    those code works well for me.

    0 讨论(0)
  • 2020-11-29 22:44

    It sounds like I problem I came accross with IE 8 only. When I was tracking down a solution I came across 2 solutions. One of them should correct this issue.

    Just to let you know it is a fix on the client machine as it is how IE coded that causes the issue.

    Fixes: http://support.microsoft.com/kb/815313 http://support.microsoft.com/kb/323308

    0 讨论(0)
  • 2020-11-29 22:51

    This issue is caused by a browser setting in Internet Explorer. In Internet Explorer go to Tools > options > Advanced options. In the section marked Security, locate and clear the Do not save encrypted pages to disk.

    0 讨论(0)
  • 2020-11-29 22:54

    Just like rymo said set Cache-Control: private, If your response header happen to have the Pragma :no-cache, you also have to change it to Pragma: token .

    0 讨论(0)
  • 2020-11-29 22:56

    if you using asp.net. remove the code with sets cache

    Comment the following

           Response.Clear();
       Response.Buffer = true;
       Response.Charset = "";
       **//Response.Cache.SetCacheability(HttpCacheability.NoCache);**
       Response.ContentType = contentType;
       Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);
       Response.BinaryWrite(bytes);
       Response.Flush();
       Response.End();
    
    0 讨论(0)
  • 2020-11-29 22:56

    We had this same issue with IE8 using an MVC controller tagged with NoCache. This sets Response.Cache.SetNoStore which breaks file downloads in IE.

    To resolve - you can reset the Http Cache Policy via reflection.

    0 讨论(0)
提交回复
热议问题