我上传&在SQL中保存PDF。然后人们可以在网页浏览器(IE)中打开该PDF。今天我更新了Acrobat Reader,并且无法在网络浏览器中打开相同的PDF。我可以将它保存到桌面上然后打开它。有一个在对话框中没有【打开】按钮,它说,文件可能已损坏无法在Internet Explorer中打开动态PDF文件
名称:admin.pdf
类型:使用Adobe Acrobat文档,37.8 KB
来源:domain.com
*
动态生成的PDF”链接是象下面这样: http://domain.com/admin.asp?cmd=Download_PDF&id=20112
我所做的每解决方案都在Adobe的网站上。我无法直接在IE8中打开PDF文件。
我的前ASP代码为:
Response.ContentType = rsFile("filetype")
Response.BinaryWrite rsFile("filedata")
然后,我只是改变了它,使PDF作为可下载的文件,现在我可以-AT最不下载&外部的Acrobat Reader(对话框显示打开[打开] [下载] [关闭]按钮):
Response.Buffer = TRUE
'Response.ContentType = "application/pdf"
Response.ContentType = rsFile("filetype")
Response.AddHeader "Content-Disposition", "attachment; filename=" & filename & ".pdf"
Response.BinaryWrite rsFile("filedata")
[在HTTP请求上创建的PDF不会在Internet Explorer中打开]的可能重复(http://stackoverflow.com/questions/12625108/pdf-created-on-http-request-wont-open-in-internet -explorer) – Dijkgraaf 2014-11-12 22:43:40
以上管理的重复问题的解决方案通过将缓存控制设置为max-age = 1而不是无缓存来实际解决了问题 – Dijkgraaf 2014-11-12 22:53:00