Re: [PHP] Interesting question re HTTP Ranges and PHP

This is a discussion on Re: [PHP] Interesting question re HTTP Ranges and PHP within the PHP General forums, part of the PHP Programming Forums category; Dan Goodes <dang@planetmirror.com> wrote: > Hi folks, > > I currently have an interesting dilemma - any ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-17-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] Interesting question re HTTP Ranges and PHP

Dan Goodes <dang@planetmirror.com> wrote:
> 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...


Now, first thing, I've tried this a while back with older versions of
apache and php and couldn't get success :(

it should be a rather simple task as long as the proper request and
response headers are sent back.

very first thing you want to send if the request if sufficient enough to
be a range request:
header('HTTP/1.0 206 Partial Content');


See RFC2616 10.2.7 for the response headers needed.

HTH,
Curt
--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0