ASP.NET Response.BinaryWrite文件下载是与SSL块 [英] ASP.NET Response.BinaryWrite file download being block with SSL

查看:335
本文介绍了ASP.NET Response.BinaryWrite文件下载是与SSL块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有产生用于下载一个动态文件的网页,并将其发送到使用Response.BinaryWrite客户端

I have a page that generates a dynamic file for download, and sends it to the client using Response.BinaryWrite.

一切似乎都很好地工作,除非我们把它搬到了使用SSL测试服务器。下载发生在一个新的窗口,我看到了什么(在IE7 / 8,但不是镀铬或FF)是标签打开,和关闭,但没有文件对话框显示。

Everything seems to work fine, except when we moved it to a test server with SSL. The download happens in a new window, and what I'm seeing (in IE7/8 but not chrome or FF) is the tab opens, and closes, but no File Dialogue is shown.

下面是完整的标题写:

Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/octet-stream"
        Response.AddHeader("Content-Length", abytFileData.Length.ToString)
        Response.AddHeader("cache-control", "private")
        Response.AddHeader("Expires", "0")
        Response.AddHeader("Pragma", "cache")
        Response.AddHeader("content-disposition", "attachment; filename=""" & pMsg!pstrFileName & """")
        Response.AddHeader("Accept-Ranges", "none")
        Response.BinaryWrite(abytFileData)
        Response.Flush()
        Response.End()

我想可以肯定,我的问题是什么提到<一个href=\"http://blogs.msdn.com/ieinternals/archive/2009/10/02/Internet-Explorer-cannot-download-over-HTTPS-when-no-cache.aspx\">here,

但我的缓存控制heade是正确的。
任何想法?

But my cache-control heade is correct. Any ideas?

推荐答案

我遇到同样的问题,一定程度的调查后,我发现$ C $的CProject提示下载时被拦截的IE安全设置的文章。如果你去工具 - > Internet选项 - >安全选项卡并查看您要访问该区域的下载选项,您需要更改自动提示文件下载来启用。造成这种情况的Internet区域的默认设置为禁用。这里的链接到我提到的文章: HTTP://www.$c$ cproject.com/KB/aspnet/SecureFileDownload.aspx

I've encountered the same problem and after some degree of investigation I found an article on codeproject suggesting that the download is being blocked by IE security settings. If you go to Tools->Internet Options->Security Tab and look at the Download options for the zone you are accessing, you need to change the "Automatic prompting for file downloads" to be Enabled. The "Internet" zone default setting for this is Disabled. Here's the link to the article I mentioned: http://www.codeproject.com/KB/aspnet/SecureFileDownload.aspx

这篇关于ASP.NET Response.BinaryWrite文件下载是与SSL块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆