File download fails over https in IE

纵饮孤独 提交于 2019-12-02 07:31:04
Uwe Keim

As user SquidScareMe writes, you have to ignore/don't touch the cache settings for Office files when downloading them over SSL.

I have an .ashx handler which has a fragment like:

// "Internet Explorer is unable to open Office documents from an SSL Web site".
// http://support.microsoft.com/kb/316431/en-us
if (!context.Request.IsSecureConnection || !isInternetExplorer(context))
{
    // No cache.
    context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    context.Response.AppendHeader(@"Pragma", @"no-cache");
}

With this function:

private static bool isInternetExplorer(HttpContext context)
{
    return context.Request.Browser.Browser == @"IE";
}

http://blogs.msdn.com/b/ieinternals/archive/2009/10/03/internet-explorer-cannot-download-over-https-when-no-cache.aspx

Update: Ahah! http://www.openrdf.org/issues/browse/SES-63

SOLUTION: Internet Explorer-> Tools menu-> Internet Options-> Advanced tab Go to the Security section all the way at the bottom. Clear the check on the "Do not save encrypted pages to disk" Close all Internet Explorer windows Start IE and download the file again

The work around solution for this problem is to activate compression at ISA. After this step the web site can transmit files without any problem! The problem occurs when you try to transmit a file over HTTPS while using no-cache.

You can fix this by specifying your Cache-Control header as follows:

Response.AddHeader("Cache-Control", "no-store, no-cache");

This way you can still specify your cache settings and it will work with https.

See: http://blogs.msdn.com/b/ieinternals/archive/2009/10/03/internet-explorer-cannot-download-over-https-when-no-cache.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!