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

curl-and-php

posting files

From: Jose Antonio Mercado <tato_at_memi.umss.edu.bo>
Date: Wed, 30 May 2001 01:00:55 -0400 (BOT)

Hi I'm traying to HTTP post files from a php script using curl functions
but it's not working.
Which curl option should I use and how should I write the value for that
option?
I'm using the fallowing code:

$ch = curl_init ();
url_setopt ($ch,CURLOPT_URL,"http://localhost/test.php");
curl_setopt ($ch,CURLOPT_POSTFIELDS,"archivo=@/tmp/foo"); // Not sure
about this
$res=curl_exec ($ch);
curl_close ($ch);

 
The post target script is recieving data like a
application/x-www-from-urlencoded and not the contents of the file foo.
M'I missing someting? is there an option for posting multipart/form-data?

Thanks

tato
}:/ J.A.

_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-05-30