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

curl-and-php

Large form POST problem

From: Cip <apinti_at_gmail.com>
Date: Tue, 21 Nov 2006 11:10:49 +0200
Is there any limitation to the amount of data that can be sent to a form via Curl?

Here is my code:

$st="...(string to post is formed from different variables read from file)...";
$lngth=strlen($st);
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url2);
$fp = fopen("example_homepage2.txt", "w");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDSIZE,
$lngth);
curl_setopt($ch, CURLOPT_POSTFIELDS, $st);
$page2=curl_exec($ch);
curl_close($ch);
fclose($fp);


I am saving the returned contents to a file. This code works fine for strings smaller than 800 characters (actually 795 or so), but my regular string is just under 9000 characters.
What can I do?

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-11-21