我已经在asp.net web论坛上发布了这个问题,但没有人回复。无法在IE8中打开.pdf文件
使用IE8我无法打开pdf文件的“ONE”页面,并给我一个错误消息“的文件已损坏,无法修复”从SQL Server 2008多个检索时,但页面我可以打开没有问题。
使用Chrome我可以打开任意数量的.pdf页面。
使用IE8从DB打开的同一页,可以直接从使用IE8的硬盘打开。
我在.asxh文件代码:
context.Response.ContentType = "application/pdf"
Dim strm As Stream = ShowNewsImage(imgName)
If Not strm Is Nothing Then
Dim buffer As Byte() = New Byte(4095) {}
Dim byteSeq As Integer = strm.Read(Buffer, 0, 4096)
Do While byteSeq > 0
context.Response.OutputStream.Write(buffer, 0, byteSeq)
byteSeq = strm.Read(Buffer, 0, 4096)
Loop
context.Response.BinaryWrite(buffer)
End If
感谢,
艾哈迈德。
以块为单位编写文件的任何原因? – 2011-02-28 11:35:31