#37760 [Opn->Csd]: CURL: How to upload a file
| From: | vrana@php.net | Date: | Fri, 17 Aug 2007 21:00:59 +0000 |
| Subject: | #37760 [Opn->Csd]: CURL: How to upload a file | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969377650@lists.php.net to get a copy of this message | ||
ID: 37760
Updated by: vrana@php.net
Reported By: kulakov74 at yandex dot ru
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
"To post a file, prepend a filename with @."
Previous Comments:
------------------------------------------------------------------------
[2006-06-09 08:58:11] kulakov74 at yandex dot ru
Description:
------------
The documentation page on curl_setopt does not clearly state how to
select form content type (application/x-www-form-urlencoded or
multipart) and how to upload a file when making a POST. I could find it
out from the user notes below the manual. It seems that the multipart
mode is triggered when the CURLOPT_POSTFIELDS parameter is an array, not
a string, and to pass a file one has to put it like "@filename". User
notes mention it, while the manual itself does not. Also, it is not
clear (if possible) how to send a form in multipart mode when the file
is empty (sometimes that's needed).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37760&edit=1