cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Limitations of range flag?

From: Daniel Beardsmore <public_at_telcontar.net>
Date: Tue, 30 Jan 2007 01:31:16 +0000

max vinci wrote:
> Hi I've been playing around with the features of cURL
> but I have yet to be able to get the range flag to
> work...are there limitations to it not referred to in
> the manual?
>
> Taking a random (and large) site digg.com for example:
>
> curl -r 0-20 -o test.txt http://www.digg.com
>
> The above still returns the same 42kb file regardless
> of whether the range flag is used or not. Is there
> something I'm missing?

By default, range only works on physical files. The above request
returns this header:

Set-Cookie: PHPSESSID=bb0ba0607a160150a0a28ed522939f93; path=/;
domain=.digg.com

The page appears to be generated dynamically with PHP and thus Apache
has nothing to go on -- the content is being created by a CGI/module and
bypassing the stage of Apache that reads file ranges. Dynamic content
including file pass-through has to have range managed manually by the
server-side script: Apache won't do this for you.

Try your request on something that's static, say a JPEG. (I don't have a
machine with cURL on running). The Digg server itself is Apache so
ranges should be supported, but not all servers support ranges in the
first place, which has to be borne in mind.
Received on 2007-01-30