Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing PDF download 2

Status
Not open for further replies.
Jan 26, 2001
550
GB
Does anyone know whether there is any way I can force a PDF document to download rather than open in the browser window, when it is clicked by the user?(i.e. coded into the page, not in their browser preferences.)

I am sick of writing "Right Click save target as to download"

Thanks guys

Nick (Web Developer)


nick@retrographics.co.uk
 
Hi HowardMarks,

take a look at:.

It has informations for you.

Hope it helps. ===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
CPC_TA- Braga
-------------------
Portugal
===================
 
The browser is data-sniffing the file, determining that content type looks like text/plan, and displaying it accordingly. Whenever IE runs across an unknown MIME type or sees no MIME type, it tries to equate the file to well-known format based on its data. In order to force a download, use the content-disposition header:
content-disposition: attachment; filename=”myword.doc”
Content-disposition should be tested to make sure it works well for you. This page explains the whole process and is good place to start:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top