使用 Chrome 时,响应 Writefile 不会创建 PDF
我使用以下代码将 PDF 发送给用户以供打开/下载。这在 IE9 中运行良好。有什么想法为什么它在 Chrome 中不起作用吗?
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename= \"" + myFile + "\"");
Response.AddHeader("Content-Length", myFile.Length.ToString());
Response.WriteFile(myFile.FullName);
Response.Flush();
Response.End();
I'm using the following code to send a PDF to users to open/download. This works fine in IE9. Any ideas why it won't work in Chrome?
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename= \"" + myFile + "\"");
Response.AddHeader("Content-Length", myFile.Length.ToString());
Response.WriteFile(myFile.FullName);
Response.Flush();
Response.End();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加这个:
Add this: