cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL and POST Large Amount of Data

From: Cris Bailiff <c.bailiff+curl_at_awayweb.com>
Date: Wed, 21 Aug 2002 10:18:53 +1000

Samantha,

perhaps this previous mailing list item might be useful?

http://curl.haxx.se/mail/archive-2002-07/0000.html

Also, if you are using php, you might find it much cleaner to use the
php-curl interface (of course, you'll need it compiled into php). This
prevents any quoting problems when calling shell with exec, as well as being
more efficient etc.

(If you must use shell, I'd start by using single quotes around your strings,
as they are a bit 'safer' than double quotes - you should use any built in
shell_escape function if php has one....)

Cris

On Wed, 21 Aug 2002 09:28, Samantha Savvakis wrote:
> HI,
>
> I'm using the cURL binary to perform a HTTP POST to a web page within
> PHP Code. I am sending XML data to this web page.
>
> The issue I've come up against if the size of the data that I'm trying
> to post and it looks like cURL is crapping out.
>
> This is the command line that I'm currently using:
>
> /usr/local/bin/curl -m 600 -d "$strXML" http://myurl.com/webpage.php -L
> -s
>
> $strXML - variable containing the XML data. I run this command using
> "exec" in PHP to call curl.
>
> The return code I receive is: 127. This means a fatal error has occured
> with cURL but that's all I know.
>
> I have read the detail about using the -F option. I do not want to POST
> the "file" as such, but rather the "DATA" in the file is I create a file
> of the XML. The manpage for cURL states:
>
> "-F : To just get the content part from a file, prefix the file name
> with the letter <. The difference between @ and < is then that @ makes a
> file get attached in the post as a file upload, while the < makes a text
> field and
> just get the contents for that text field from a file."
>
> So I've tried going:
>
> /usr/local/bin/curl -m 600 -F </tmp/tempfile.xml
> http://myurl.com/webpage.php -L -s
>
> /tmp/tempfile.xml - contains the XML data. This isn't working.I'm
> getting a return code of "2" meaning: "Failed to initialize".
>
> I'm at a loss. I need to post this large amount of XML data to a remote
> site and don't know how to get it there.
>
> Any ideas?
>
> Thanks,
> Sam
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Received on 2002-08-21