note 81161 added to function.curl-setopt
| From: | mavook at gmail dot com | Date: | Sat, 16 Feb 2008 06:26:07 +0000 |
| Subject: | note 81161 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136197@lists.php.net to get a copy of this message | ||
If you try to upload file to a server, you need do CURLOPT_POST first and then fill
CURLOPT_POSTFIELDS.
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
^^ This will post multipart/form-data
Next example don't work:
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($ch, CURLOPT_POST, 1);
Sets to content-lenght:0 if $postvars an array.
----
Server IP: 195.54.192.44
Probable Submitter: 85.95.173.138
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/81161
Del: integrated -- https://master.php.net/note/delete/81161/integrated
Del: useless -- https://master.php.net/note/delete/81161/useless
Del: bad code -- https://master.php.net/note/delete/81161/bad+code
Del: spam -- https://master.php.net/note/delete/81161/spam
Del: non-english -- https://master.php.net/note/delete/81161/non-english
Del: in docs -- https://master.php.net/note/delete/81161/in+docs
Del: other reasons-- https://master.php.net/note/delete/81161
Reject -- https://master.php.net/note/reject/81161
Search -- https://master.php.net/manage/user-notes.php