Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 7.5 iis7.5 Response.ContentType=";申请表/pdf";导致连接重置_Iis 7.5_Content Type - Fatal编程技术网

Iis 7.5 iis7.5 Response.ContentType=";申请表/pdf";导致连接重置

Iis 7.5 iis7.5 Response.ContentType=";申请表/pdf";导致连接重置,iis-7.5,content-type,Iis 7.5,Content Type,我正在使用IIS发送一个经典asp格式的pdf文档(由abcpdf 8生成) 没有任何内容进入浏览器 FF:连接被重置-页面加载时与服务器的连接被重置 IE:Internet Explorer无法显示网页-Internet连接已丢失 Chrome:此网页不可用-错误101(net::ERR_CONNECTION_RESET):连接已重置 代码如下: Set theDoc = CreateObject("ABCpdf8.Doc") theDoc.FontSize = 96 thedoc.Ad

我正在使用IIS发送一个经典asp格式的pdf文档(由abcpdf 8生成)

没有任何内容进入浏览器

  • FF:连接被重置-页面加载时与服务器的连接被重置
  • IE:Internet Explorer无法显示网页-Internet连接已丢失
  • Chrome:此网页不可用-错误101(net::ERR_CONNECTION_RESET):连接已重置
代码如下:

Set theDoc = CreateObject("ABCpdf8.Doc") 
theDoc.FontSize = 96
thedoc.AddText "Hello World"

theData = theDoc.GetData()

Response.ContentType = "application/pdf" '<-- culprit?
Response.AddHeader "content-length", UBound(theData) - LBound(theData) + 1
Response.AddHeader "content-disposition", "inline; filename=MyPDF.PDF"
Response.BinaryWrite theData        
设置Doc=CreateObject(“ABCpdf8.Doc”)
theDoc.FontSize=96
thedoc.AddText“Hello World”
theData=theDoc.GetData()

Response.ContentType=“application/pdf”一位同事解决了这个问题

Response.BinaryWrite
Response.flush  '<-- this fixes it.
Response.BinaryWrite
响应:刷新'