页面无法使用asp.net应用程序在Ipad上查看.doc文件

时间:2012-11-27 11:18:37

标签: asp.net .net

我有打印机页面,它将获得.doc格式的二进制文件,然后将其打印

它在IE,Firfox,chroom上工作

但是当我试图在ipad上查看它时它给了我空页? 下面是代码:

                Dim filepath() As Byte
                filepath = Session(Request.QueryString("id"))
                Response.ClearHeaders()
                Response.ClearContent()
                Response.AddHeader("content-disposition", "attachment;filename=""MyFile.doc""")
                Response.AddHeader("Content-Description", "myfiles")
                Response.AppendHeader("Content-Type", "application/msword")
                Response.AppendHeader("Content-Transfer-Encoding", "binary")
                Response.AppendHeader("Pragma", "public")
                Response.AppendHeader("Cache-Control", "must-revalidate")
               Response.BinaryWrite(filepath)
                 Response.Flush()
                Response.End()

1 个答案:

答案 0 :(得分:1)

尝试以ms字开启文档并再次保存 用microsoft wrod格式然后检查

相同的代码:

 Dim filepath() As Byte
            filepath = Session(Request.QueryString("id"))
            Response.ClearHeaders()
            Response.ClearContent()
            Response.AddHeader("content-disposition", "attachment;filename=""MyFile.doc""")
            Response.AddHeader("Content-Description", "myfiles")
            Response.AppendHeader("Content-Type", "application/msword")
            Response.AppendHeader("Content-Transfer-Encoding", "binary")
            Response.AppendHeader("Pragma", "public")
            Response.AppendHeader("Cache-Control", "must-revalidate")
           Response.BinaryWrite(filepath)
             Response.Flush()
            Response.End()