OK, here's a different problem.

If I call a pdf file directly, the Acrobat plugin begins to display the file almost immediately. Here is the reponse header for calling the file directly:

HTTP/1.1 200 OK
Date: Thu, 16 Oct 2003 20:41:28 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/4.3.3 mod_perl/1.26
X-Meta-MSSmartTagsPreventParsing: TRUE
X-MSSmartTagsPreventParsing: TRUE
Last-Modified: Thu, 16 Oct 2003 17:08:17 GMT
ETag: "94174-341fcb-3f8ed081"
Accept-Ranges: bytes
Content-Length: 3416011
Connection: close
Content-Type: application/pdf


I wrote a pdf-serving script for anti-leech purposes, and it works fine, except that the acrobat plugin waits for the entire file to come down the pipe before anything is displayed. The mystery for me is that the headers--the important ones anyway--look exactly the same. Dig:

HTTP/1.1 200 OK
Date: Thu, 16 Oct 2003 20:44:45 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/4.3.3 mod_perl/1.26
X-Meta-MSSmartTagsPreventParsing: TRUE
X-MSSmartTagsPreventParsing: TRUE
X-Powered-By: PHP/4.3.3
X-Accelerated-By: PHPA/1.3.3r2
Accept-Ranges: bytes
Content-Length: 3416011
Connection: close
Content-Type: application/pdf


Here's what's serving the file:

header("Content-Type: application/pdf");
header("Accept-Ranges: bytes");
header("Content-Length: ".filesize($thefile));
readfile($thefile);

Can anybody tell me why the browser is waiting for the entire file before it's displayed(using php)? I don't think the average user will have the patience to stare at a blank browser waiting for the file.

Thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to