PHP Classes

Read from offset ?

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Read from offset ?  >  (Un) Subscribe thread alerts  
Subject:Read from offset ?
Summary:?
Messages:2
Author:vMyth
Date:2008-04-08 10:32:15
Update:2008-04-08 11:07:24
 

  1. Read from offset ?   Reply   Report abuse  
Picture of vMyth vMyth - 2008-04-08 10:32:20
Hello,
I'm opening connection to a MP3 file stream and I don't want to get the whole file, just the last 128 bytes ( which contain ID3 tags ). Is this possible to do so ? Thanks.

  2. Re: Read from offset ?   Reply   Report abuse  
Picture of vMyth vMyth - 2008-04-08 11:07:24 - In reply to message 1 from vMyth
OK, I have found the way to do so, just add a request header :

Range: bytes={start offset}-{end offset}

If the server does not response a header name "Accept-Ranges" or return this header value as "none" then the server doesn't support reading only a part of the response.

Anyway, thank you very much for your great class :) !