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

curl-and-php

Re: String length limitation with curl.

From: Manish Katiyar <mkatiyar_at_gmail.com>
Date: Thu, 16 Apr 2009 09:50:44 +0530

On Thu, Apr 16, 2009 at 7:53 AM, Manish Katiyar <mkatiyar_at_gmail.com> wrote:
> 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.

Hi,

Finally I figured it out. It was due to a bug in lighthttpd
http://redmine.lighttpd.net/issues/show/1017.

Thanks a lot -

>
> /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
>

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