note 75193 deleted from ref.curl by felipe
| From: | felipe@php.net | Date: | Sun, 30 Mar 2008 19:04:10 +0000 |
| Subject: | note 75193 deleted from ref.curl by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137766@lists.php.net to get a copy of this message | ||
Note Submitter: Mr.KTO
----
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.