cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Download pages partially??

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 28 Jan 2004 11:00:42 +0100 (CET)

On Mon, 26 Jan 2004, erazer wrote:

> Hi.. I wonder it's possible to parts of pages?. Lets say that I only want
> information located in first the 1024 bytes, and rest of the 400kb of the
> page are just junk? This will save me a lot of bandwitdh :)

> I found some information on this page
> http://www.zend.com/manual/function.curl-setopt.php

> I tried this function, which looked like the thing that I needed:
> curl_setopt($ch, CURLOPT_RANGE, 0-1023);

That's how it works, yes.

> But too bad, I only found one page working with that: http://curl.haxx.se/ I
> tried with alot of other pages but noone works, just haxx.se. Why? Maybe
> there is another way to do it?

Servers may ignore the range header that this method uses.

You can of course also simply stop downloading the response body, but I don't
think the PHP/curl interface allows you to do that.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-28