iTextSharp generated PDF: How to send the pdf to the client and add a prompt?

前端 未结 5 493
半阙折子戏
半阙折子戏 2020-12-01 17:25

I have generated a pdf using iTextSharp, when its created it saves automatically in the location provided in my code on the server not on the client side and of course witho

5条回答
  •  情书的邮戳
    2020-12-01 17:59

    You need to send a content disposition header to the users browser. From memory the code is something sort of like this:

    Response.ContentType = "application/pdf";
    Response.AppendHeader("Content-Disposition","attachment; filename=nameofthefile.pdf");
    

提交回复
热议问题