我将图像放入字节[]。我需要在asp.net中将其打开到adobe文件中。我使用以下代码:
byte[] bytes = contractimage.Value.Bytes;
if (bytes == null)
{
Response.Write("Not found.");
Response.End();
}
else
{
Response.AddHeader("content-disposition",
"attachment;filename=statement" + contractGuid.ToString() + ".pdf");
Response.ContentType = "application/pdf";
Response.OutputStream.Write(bytes, 0, bytes.Length);
Response.End();
}
但这段代码显示了一个错误,即adobe无法显示该文件可能已损坏。
请建议