cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Partially downloading a web page

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 3 Aug 2006 14:45:19 -0700

On Thu, Aug 03, 2006 at 07:33:14PM +0000, mark harrington wrote:
> I’m trying to download part of the html code of a web site. I have
> attempted to use the libcurl library and have managed to achieve this for
> some web pages using CURLOPT_RANGE. However I cannot get it to work with
> the web page that I want to do this to, it would seem that the server does
> not support ranges. Does anyone know any way of getting round this.

If the server won't let you do it, then it won't let you do it!

> The part of the web page I want to download is at the beginning of the
> file. If it’s not possible to get round the range issue, is it possible to
> terminate the download after a specified number of bytes has been received.
> I have looked in the libcurl library but cannot determine how to do this.

You can terminate downloads early by returning an error indication in your
CURLOPT_WRITEFUNCTION function.

>>> Dan

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