cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to download few bytes of file and then stop the download

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 29 Oct 2008 08:25:18 -0700

On Wed, Oct 29, 2008 at 04:50:15PM +0200, Meir Yanovich wrote:
> Hello all
> im using cURl with the easy handler to visit html pages and it working great
> now i need to do something more advance i need to download binary file
> and check its header
> when i recive the few bytes that contain the header to stop the download .
> that is i need to get only the file header , i dont need the all file .
> what is the best aproch for this?

Use CURLOPT_RANGE. If the remote server doesn't support it, then return an
error code in the write callback once you've received enough data.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-10-29