Are you using Internet Explorer? Then it's a "feature" of IE--it ignores
the disposition headers sent by your server because its registry tells
it that PDF files must be "viewed" inline. There's a way around it,
although it's a bit kludgy--I wrote a small article about it that you
can find here (it's in PDF format, as well):

Essentially, you're telling IE to download a file with the extension
".pdf " (not the space) so that it can't match the MIME type anymore and
will follow your suggestion of downloading the file instead of
displaying it inline.

Hope this helps!


php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming

Check us out on the web at!
--- Begin Message ---
i was reading about looking for a way to force a download of a txt file, 
rather than the browser displaying the file.
i ran into header() that seems to be able to accomplish it... but seeing as i'm very 
much a newbie at php, i can't seem to make this work
if the file i want to download is

how would i impliment this:
// We'll be outputting a PDF
header("Content-type: application/pdf");

// It will be called downloaded.pdf
header("Content-Disposition: attachment; filename=downloaded.pdf");

// The PDF source is in original.pdf

--- End Message ---
PHP General Mailing List (
To unsubscribe, visit:

Reply via email to