[thelist] PDF link behaviour

Wade Armstrong wade_lists at runstrong.com
Thu Jan 9 11:44:10 CST 2003


on 1/9/03 2:43 AM, Francois Jordaan at francois.jordaan at wheel.co.uk wrote:

> Is it easy to override the browser's default behaviour of displaying a
> linked PDF in the browser window, and force a download instead?

If you send the MIME-type "application/octed-stream" or
"application/x-msdownload" (or in fact any MIME-type unknown to the browser,
such as "francois/jordaan"), the browser will prompt the user to save the
file.
In ASP, you can set the MIME-type using
Response.ContentType="application/octet-stream"
In PHP, use header("Content-type: application/octet-stream")

Wade




More information about the thelist mailing list