How/When is $_SERVER['HTTP_RANGE'] or $_ENV['HTTP_RANGE'] set? I am working on a resume download script that requires the HTTP_RANGE to be set... but no matter what i do i cant find how/when its set. Thanks.
This link explains a lot about HTTP_RANGE. It still leaves out two important points...
The server will send this header only for documents for which it will
be able to satisfy the byte range request, e.g. for PDF documents, or
images, which can be partially reloaded if the user interrupts the
page load, and image gets only partially cached.
What types of files satisfy the byte range request? also,
The Request-Range header is simply ignored
by a server that does not support it, and it will send the entire
document as a response.
You could write a test
1) open a socket
2) create a stream context with header information (including the range)
3) send it to a script of your choice
4) have that script look for the header range info... et voila
I guess you don't, just test whether it's set or not, using isset() as you demonstrated below. This is the only environment variable that PHP support to let you know.
What i thought you wanted to know was whether your server supports it. Check the documentation for your web server manual then. If it's apache the chances are it's a "yes", I can't speak for any other web services. It is after all standard in the http ietf draft you specified, which most web services conform to.
Or, as I suggested, write the sequence of steps that I outlined in my previous post. Create a header yourself, and send it to your server, then use the HTTP_RANGE to see if it's set.