--- Ken <[EMAIL PROTECTED]> wrote:
> What I want to do is write something simple in PHP that makes
> an HTTPrequest, takes the data received, and passes it through.
> 
> Specifically, I am hoping to retrieve just a part of a file
> from the web server. If I wanted the whole file I would just do
> header("Location:...");

Just to be clear (I'm honestly not trying to be picky), but you're describing
two separate things here, from my interpretation. I am interpreting your
description of "passing it through" to mean that you want to make an HTTP
request with your PHP script and return the content of that response as the
content of your own response to the user. Is this correct?

Using the Location header makes your response to the user a 300-level response
(though you have the option of specifying status code now), meaning you're
telling them that the resource that they want is somewhere else. That
"somewhere else" is specified in your Location header, and the user's browser
will automatically make another request to that URL. You are no longer part of
the picture at this point.

> I imagine I would want to form a basic get header request, with URL,
> whatever else I need, and a "Range:bytes=1000-2000" header. If I
> understand correctly, the (HTTP/1.1) web server would return the
> document I want, just bytes 1000-2000.

You need a space after your colon, but yeah. However, keep in mind that a Web
server that does not understand range requests will return the entire resource
in a 200 response. If it is a partial response, you will know, because it will
be a 206 response and should include a Content-Range header. This is all
assuming that you do not make an out-of-range request.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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

Reply via email to