Write PDF stream to response stream

后端 未结 2 702
你的背包
你的背包 2021-01-06 16:52

I am having problems when I tried to run the following code from my asp.net page. The code is from another post (http://stackoverflow.com/questions/5828315/write-pdf-strea

2条回答
  •  情歌与酒
    2021-01-06 17:10

    Consider using HttpResponse.TransmitFile (ASP.NET >= 2.0), especially for large files because it writes the file without buffering it into server memory.

    Also, make sure you always set the Response.ContentType property to the appropriate MIME type or browsers will sometimes have trouble with downloading your files correctly, especially if you are writing the file from a handler:

    Response.ContentType = "application/pdf";
    

提交回复
热议问题