Re: range header in curl?
| From: | shiplu | Date: | Mon, 22 Nov 2010 00:31:50 +0000 |
| Subject: | Re: range header in curl? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309602@lists.php.net to get a copy of this message | ||
On Mon, Nov 22, 2010 at 5:05 AM, Tontonq Tontonq <rootdot@gmail.com> wrote:
> hi im downloading files from h0tf1le as a premium user by curl i want to do
> something like streaming i want it resend to user what it got from server
> i couldnt find any resource about curl and streaming the executed source
> so i did by the Range header but sometimes i see files are corrupted i
> check
> the logs
>
> GET
>
>
> http://s137.hotfile.com/get/7006d266367d7975861e5f7200b604ad478674fc/4ce9a4ff/1/f37a0969e2e26077/332dfdf/2137758/pimp.rarHTTP/1.1
>
> User-Agent<http://s137.hotfile.com/get/7006d266367d7975861e5f7200b604ad478674fc/4ce9a4ff/1/f37a0969e2e26077/332dfdf/2137758/pimp.rarHTTP/1.1%0AUser-Agent>:
> Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2)
> Gecko/20100115 Firefox/3.6
> Host: s137.hotfile.com
> Pragma: no-cache
> Accept: */*
> Connection: Keep-Alive
> Range: bytes=1-2
>
> i only get 1 byte for learn length
>
Not sure why your are getting 1 byte. You should get 2 bytes. Is the size of
pimp.rar 2 bytes? In that case first 2 byte will returned by bytes=0-1 range
specifier instead of bytes=1-2
Check this spec out
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
May be this will help you.
--
Shiplu Mokaddim
http://talk.cmyweb.net