Re: Interesting question re HTTP Ranges and PHP

From: Date: Thu, 17 Jul 2003 05:28:12 +0000
Subject: Re: Interesting question re HTTP Ranges and PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-155534@lists.php.net to get a copy of this message
--- Dan Goodes <dang@planetmirror.com> wrote: > 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? I think you will find all header in the $_SERVER array. It is definitely possible to do what you're wanting, but I'm not sure exactly how simple you will think it is. Maybe there is some existing code someone has written that does this sort of thing for you, but I'm not aware of any. At most, you would just have to parse the Range header yourself to deduce what byte range to serve. > Also is there a way for PHP to tell apache which response code to > send? Yeah, this should work: header('HTTP/1.1 206 Partial Content'); Hope that helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/

« previous php.general (#155534) next »