Re: force download with header()
| From: | Marco Tabini | Date: | Sun, 08 Dec 2002 15:10:01 +0000 |
| Subject: | Re: force download with header() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127433@lists.php.net to get a copy of this message | ||
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):
http://www.phparch.com/issuedata/2002/december/sample.php
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!
Cheers,
Marco
--
------------
php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming
Check us out on the web at http://www.phparch.com!