ID: 50060 Updated by: scott...@php.net Reported By: bugs dot php dot net at sgerrand dot com -Status: Open +Status: Bogus Bug Type: cURL related Operating System: Linux (Ubuntu x86_64 2.6.31-14) PHP Version: 5.2.11 New Comment:
@ has a special meaning with cURL and takes the contents of the file. Previous Comments: ------------------------------------------------------------------------ [2009-11-03 07:29:36] bugs dot php dot net at sgerrand dot com Description: ------------ PHP's cURL library dies returning the error message "failed creating formpost data" when trying to use an array that contains a value starting with '@'. If the array is changed to a string in URL encoded like format, the problem does not occur. Reproduce code: --------------- <?php $url = 'http://www.php.net'; $postData = array('key' => '@value'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); if (! curl_exec($ch) ) print 'cURL error: ' . curl_error($ch); else print "cURL success"; curl_close($ch); ?> Expected result: ---------------- cURL success Actual result: -------------- cURL error: failed creating formpost data ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50060&edit=1