note 32023 deleted from function.header by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:43:29 +0000 |
| Subject: | note 32023 deleted from function.header by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55650@lists.php.net to get a copy of this message | ||
Note Submitter: jmertic@ncscredit.com
----
I've been trying to validate PDF Files on Win2k/IIS 5/PHP 4.3.1. Everything worked fine on
Netscape/Mozilla, but IE said it could not find the file. I now use the following method, and all
seems to work well now:
$file = $_GET['uri']; // filename is passed via GET variable
$len = filesize($file);
header("Cache-Control: public");
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=" . $_GET['uri'] . "");
header("Accept-Ranges: bytes");
header("Content-Length: $len");
readfile($file);
The "Accept-Ranges: bytes" seemed to be the key to solving this problem.
"Cache-Control: public" was needed in order to use my cookie-based auth scheme.