By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

How to Force file download box when clicking on a link for a .pdf file

P: n/a

Can some one help me out?
How to Force file download box when clicking on a link for a .pdf file.

Normally it opens the pdf in IE itself, instead it should ask for (open

, save and cancel)
Similarly , also clarify that, is there any other method other than
Response.Redirect(filename) to download a file. If so what it is?
Please do help me
thanks in advance

Mar 24 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
You have to send out a ContentType header:

Response.AppendHeader ( "Content-Type", "application/pdf" )

And then add another header called Content-Disposition

Response.AppendHeader ( "Content-Disposition", "attachment;
filename="downloaded.pdf" )

If you are going to use this then you will have to output the PDF from
your aspx page (I am sorry but I have never done this in ASP.NET so I
don't know how you would go about doing this...).

Mar 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.