Re: Open Download-Box
| From: | Michael Virnstein | Date: | Thu, 18 Apr 2002 15:02:44 +0000 |
| Subject: | Re: Open Download-Box | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93540@lists.php.net to get a copy of this message | ||
this is a problem of IE, not of PHP.
it seems that IE is ignoring headers in some cases.
Regards Michael
"Martin Thoma" <martin@radiok2r.de> schrieb im Newsbeitrag
news:3CBEC817.AF7DAB7A@radiok2r.de...
> Hello! I have a PDF-File, which the user should download (it should not
> open in the browser, even if the Adobe-Reader-Pluging is installed). I
> use:
>
> $filename = $DOCUMENT_ROOT."/".$QUERY_STRING;
> $fd = fopen ($filename, "rb");
> $contents = fread ($fd, filesize ($filename));
> fclose ($fd);
>
> header("Content-type: application/octet-stream");
> header("Content-Disposition:attachment;filename=$savename");
>
> echo $contents;
>
> This doesn't work in IE (Version 6, 5 is not tested yet): When I get the
> download-box and I choose "open" instead of "save", the download-box
> opens again! Then pressing "open", everything is okay, but why is the
> box opened twice?
>
> Martin
>
>