note 75193 added to ref.curl
| From: | Mr dot KTO at osu1 dot php dot net | Date: | Thu, 17 May 2007 14:43:22 +0000 |
| Subject: | note 75193 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126661@lists.php.net to get a copy of this message | ||
There is a bug in file uploading using multipart/form-data. (WinXP, PHP 4.4.4, libcurl/7.14.0)
curl_setopt($ch, CURLOPT_POSTFIELDS, array("userfile" => "@filename.ext");
produces error "failed creating formpost data"
Solution - use absolute path for uploaded file. As:
curl_setopt($ch, CURLOPT_POSTFIELDS, array("userfile" =>
'@'.realpath('filename.ext'));
p.s: Also slash before '@' don't escape it, so post values with first '@'
by multipart mothod not supported.
----
Server IP: 69.147.83.197
Probable Submitter: 89.110.62.173
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit -- https://master.php.net/note/edit/75193
Del: integrated -- https://master.php.net/note/delete/75193/integrated
Del: useless -- https://master.php.net/note/delete/75193/useless
Del: bad code -- https://master.php.net/note/delete/75193/bad+code
Del: spam -- https://master.php.net/note/delete/75193/spam
Del: non-english -- https://master.php.net/note/delete/75193/non-english
Del: in docs -- https://master.php.net/note/delete/75193/in+docs
Del: other reasons-- https://master.php.net/note/delete/75193
Reject -- https://master.php.net/note/reject/75193
Search -- https://master.php.net/manage/user-notes.php