cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-and-php mailing list Archives

String length limitation with curl.

From: Manish Katiyar <mkatiyar_at_gmail.com>
Date: Thu, 16 Apr 2009 07:53:21 +0530

Hi ,

Is there any limitation about how long a string can be while sending
data from curl. I have below code. It works when the file is small but
not when the file size is large. Or does it matter how many nodes are
there in xml file, because when i delete some nodes it works.

/home/mkatiyar> cat postxml.php
<?php
function postData($postFileds,$url){
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_POST ,1);
                curl_setopt($ch, CURLOPT_POSTFIELDS ,$postFileds);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
                curl_setopt($ch, CURLOPT_HEADER ,0);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
                $data = curl_exec($ch);
                curl_close($ch);
                return $data;
        }

$xmlData = file_get_contents("report.xml");
$postFileds = 'data='. urlencode($xmlData);

$result=postData($postFileds,"http://localhost/auto/processxml.php");
echo $result;
?>

/home/mkatiyar> wc report.xml
 23 25 714 report.xml <====== doesn't work for this size.
/home/mkatiyar/gold> wc abusereport.xml
 19 21 589 report.xml <==== Works for this size.

-- 
Thanks -
Manish
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-04-16

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET