Results 1 to 7 of 7

Thread: Http_range

  1. #1
    Join Date
    Mar 2008
    Posts
    55

    Unanswered: Http_range

    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.

  2. #2
    Join Date
    Mar 2008
    Posts
    55
    http://tools.ietf.org/id/draft-ietf-...trieval-00.txt

    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.
    How do i know if my server supports it?

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    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

  4. #4
    Join Date
    Mar 2008
    Posts
    55
    4) have that script look for the header range info...
    Besides a
    PHP Code:
    isset($_SERVER['HTTP_RANGE']) 
    how do i know range in fo is being sent back?

  5. #5
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    how do i know range in fo is being sent back?
    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.

  6. #6
    Join Date
    Mar 2008
    Posts
    55
    Still looking for info on this subject. thanks.

  7. #7
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    If you use streams you can analyse the header that is sent back to see if it contains the HTTP_RANGE part.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •