Reputation: 941
I am using ASP.NET, C# and iTextSharp for creating a PDF. Then I am using this code for transmitting the file.
Response.TransmitFile(filename);
So I want to display a dialog box which will request the user whether to open/save/cancel when they click on the generate button.
Thanks.
Upvotes: 0
Views: 1869
Reputation: 941
Responce.AddHeader("content-disposition","attachement;filename=name.pdf");
Response.TransmitFile(filename);
Here content-disposition is the one which is used for displaying the dialog box.
Upvotes: 1
Reputation: 17724
You can write it to the response directly. Browser will show the save as/open depending on the type sent.
Response.ContentType = "application/pdf";
Response.WriteFile(@"C:\Downloads\Test.pdf");
Response.Flush();
Upvotes: 1
Reputation: 2921
As I remember, is the navigator who decides make the download for load it inside navigator.
Normally the unique way to download it is offer a link and guide the user to right click and to choose Save As
Upvotes: 0