Doc #52331 [Com]: Use of @ in CURLOPT_POSTFIELDS is new
| From: | dscotese at litmocracy dot com | Date: | Sat, 23 Oct 2010 20:48:53 +0000 |
| Subject: | Doc #52331 [Com]: Use of @ in CURLOPT_POSTFIELDS is new | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5386@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52331&edit=1
ID: 52331
Comment by: dscotese at litmocracy dot com
Reported by: dscotese at litmocracy dot com
Summary: Use of @ in CURLOPT_POSTFIELDS is new
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux/Windows I think
PHP Version: 5.3.2
Assigned To: kalle
Block user comment: N
New Comment:
Ron wrote:
If you're setting POSTFIELDS as a string you need to encode like so:
curl_setopt($ch, CURLOPT_POSTFIELDS, "file=@/home/ross/image.png");
For example, using http_build_query().
Wouldn't this simulate the submission of a form in which an <input> of
type='file' has been submitted with the enter key, and the data returned
to the server is an encoded file as the "value" in the name-value pair
with the name "file"? That would be different from sending the file
itself as the post data, not encoded, but rather relying only on the
header to indicate its length. I don't know how such a a post data
could be created by a <form> - I doubt it's possible. I do know that
there are servers that expect that kind of post data though.
Previous Comments:
------------------------------------------------------------------------
[2010-10-23 17:05:28] kalle@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.
------------------------------------------------------------------------
[2010-10-23 17:05:23] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304665
Log: Fixed bug #52331 (Use of @ in CURLOPT_POSTFIELDS is new)
------------------------------------------------------------------------
[2010-10-20 05:44:46] dscotese at litmocracy dot com
curl
cURL support enabled
cURL Information 7.19.6
Age 3
Features
AsynchDNS No
Debug No
GSS-Negotiate No
IDN Yes
IPv6 No
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
krb4 No
libz Yes
CharConv No
Protocols tftp, ftp, telnet, dict, ldap, ldaps, http, file, https,
ftps
Host i686-pc-mingw32
SSL Version OpenSSL/0.9.8l
ZLib Version 1.2.3
------------------------------------------------------------------------
[2010-10-20 05:14:25] kalle@php.net
Which version of cURL are you experincing this limitation?
------------------------------------------------------------------------
[2010-07-26 12:27:30] ross@php.net
If you're setting POSTFIELDS as a string you need to encode like so:
curl_setopt($ch, CURLOPT_POSTFIELDS, "file=@/home/ross/image.png");
For example, using http_build_query().
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=52331
--
Edit this bug report at http://bugs.php.net/bug.php?id=52331&edit=1