1
22
尝试添加 响应。 在调用Response.BinaryWrite()之后。 在response.binarywrite之后,您可能无意中发送了其他内容,这可能会混淆浏览器。end将确保浏览器只得到您真正想要的。 |
2
16
这对我们有用。我们从SQL Reporting Services创建PDF。 |
3
7
我们已经成功地使用了它。writefile为您完成下载,并在结尾处使用flush/end将其全部发送给客户机。
|
4
5
既然您直接从文件系统发送文件,而不进行中间处理,为什么不使用
(我怀疑你的问题是由于
|
5
4
它是
不
建议拨打
您的代码看起来有点像这样:
|
6
2
请在使用response.transmitfile之前阅读此内容: http://improve.dk/blog/2008/03/29/response-transmitfile-close-will-kill-your-application |
7
1
可能缺少响应。关闭de binary流 |
8
1
在我的MVC应用程序中,我为所有响应启用了gzip压缩。如果您正在从带有gzip响应的Ajax调用中读取此二进制写入,那么您将获得gzip字节数组,而不是需要使用的原始字节数组。
} “var blob=新blob([response.data],类型:类型];” 如果您不首先解压缩,那么当您将字节数组转换为JavaScript中的文件时,这将给您提供一个试图打开的无效/损坏的文件。 要解决此问题,您可以选择阻止gzip压缩此二进制数据,以便将其正确转换为正在下载的文件,或者在将其转换为文件之前,必须在JavaScript代码中解压缩该gzip数据。 |
9
0
除了igor的response.close()之外,我还将添加response.flush()。 |
10
0
我还发现有必要增加以下内容:
如果我不包括这个,我的jpeg就损坏了,以字节为单位的大小增加了一倍。 但仅当处理程序从ASPX页返回时。它似乎是从一个阿什克斯运行这是不需要的。 |
Robert King · Unity C#语法问题-转换位置 1 年前 |
JBryanB · 如何从基本抽象类访问类属性 1 年前 |
law · 检查答案按钮的输入字符串格式不正确 2 年前 |
i_sniff_ket · 在unity之外使用unity类 2 年前 |