Forum Moderators: coopster

Message Too Old, No Replies

Limit cURL

         

Elric99

1:23 pm on Nov 23, 2009 (gmt 0)

10+ Year Member



I'd like to limit the amount of a page that Curl reads. Is there a simple setting to limit the amount of data?

Here's my current setup:

$ch = curl_init($link);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);

$p = curl_exec($ch);
curl_close($ch);

Thank you

aprendelo

5:13 pm on Nov 23, 2009 (gmt 0)

10+ Year Member



You can try with this:
//Response will be read in chunks of 64000 bytes
curl_setopt($ch, CURLOPT_BUFFERSIZE, 64000);