curl-library
Re: stop downloading after x bytes?
From: Brian Dessent <brian_at_dessent.net>
Date: Fri, 06 Jan 2006 01:05:09 -0800
Date: Fri, 06 Jan 2006 01:05:09 -0800
Andrew wrote:
> I am aware of the max-size option (where curl won't download if the file
> is larger than x bytes), but i'm looking to download the first x bytes
> of a file, regardless of how large it is.
>
> I am thinking about putting about putting a size checker in the
> WriteMemoryCallback function, however I want to use this in a
> multi-threaded environment, and I want to be able to set the size to
> stop downloading at as a paramater, not a global variable.
Have you tried simply using --range / CURLOPT_RANGE with "0-nnn"?
Brian
Received on 2006-01-06