Tanaji Kamble
Tanaji Kamble

Reputation: 363

IE blocks pdf file save popup

I have created savepdf.aspx which writes pdf file contents to response as attchment by following code

       Response.Clear();
        Response.AppendHeader("Content-Disposition", "attachment; filename=Sample.pdf");
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(transcriptFileBytes);
        Response.End();

When click on button of parent page savepdf.aspx opens as popup, which writes pdf file contens.

Now problem is popup just gets open and close immediatly without prompting for file save diaolog box.

But, when I hold Ctrl key while clicking on parent button, popup does appears and ask for file open save dialog box. This time works fine.

How to fix this behaviour through code?

Upvotes: 0

Views: 503

Answers (2)

asd
asd

Reputation:

Don't use Response.End() here please comment this line and close this popup window by using javascript.

I hope it will resolve you porblem...

Upvotes: 0

dahlbyk
dahlbyk

Reputation: 77530

You cannot change this behavior from the server - it's a client-side configuration for handling of disposition attachment, which you have set correctly.

Upvotes: 1

Related Questions