Interesting question re HTTP Ranges and PHP
| From: | Dan Goodes | Date: | Thu, 17 Jul 2003 05:05:59 +0000 |
| Subject: | Interesting question re HTTP Ranges and PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-155531@lists.php.net to get a copy of this message | ||
Hi folks,
I currently have an interesting dilemma - any help is appreciated (if
possible, CC directly to dang@planetmirror.com as well as the list).
What Ive got is a PHP wrapper script that performs authetication, and uses
"readfile()" to return the requested file. So a user requests
/path/to/file, PHP interveins and performs authentication, then does a
realfile on /REAL/path/to/file to return the file.
What I want is for the PHP script to read ALL the headers for the request
(in particular, RANGE headers), and then return the relevant portion of
the file. Can this be done fairly simply? Obviously there has to be
additional headers returned to the client by the script when it's
returning a RANGE response. Also is there a way for PHP to tell apache
which response code to send? i.e. in my testing even tho I send a "resume
code" with wget, apache's response is 200 OK, not 206 Partial Content...
Any help/advice is appreciated...
-Dan