我有一个web服务,当我从处理程序页面(.ashx)调用它时,它运行得很好。
我的web服务返回一个zip文件。
但是当我从我的aspx页面调用相同的代码时,我得到了一个损坏的zip文件。调用代码如下所示,在ashx类和aspx页面中是相同的。请指教
Dim service As New doc()
Dim b() As Byte
b = service.GetCoverScanTest(New String() {"50BC2781-E4F9-4C0C-AE32-34D4118BD98F"}, System.Configuration.ConfigurationSettings.AppSettings("eDocsSecurekey").ToString())
Response.ContentType = "application/zip"
Response.AddHeader("Content-disposition", "attachment; filename=CoverScan.zip")
Response.BinaryWrite(b)发布于 2010-09-07 18:51:19
您可能需要一个Response.Clear()来去除aspx中可能已经存在的任何位的html。
https://stackoverflow.com/questions/3657922
复制相似问题