php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37760 CURL: How to upload a file
Submitted: 2006-06-09 08:58 UTC Modified: 2007-08-17 21:00 UTC
Votes:39
Avg. Score:4.8 ± 0.7
Reproduced:24 of 24 (100.0%)
Same Version:22 (91.7%)
Same OS:22 (91.7%)
From: kulakov74 at yandex dot ru Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2006-06-09 08:58 UTC] 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). 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-17 21:00 UTC] vrana@php.net
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 @."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 06:01:34 2024 UTC