Re: Finally, PDF Header for PDF stuffs that work....

From: Date: Thu, 16 Oct 2003 21:30:30 +0000
Subject: Re: Finally, PDF Header for PDF stuffs that work....
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-166358@lists.php.net to get a copy of this message
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!

« previous php.general (#166358) next »