Doc #52331 [Opn->Csd]: Use of @ in CURLOPT_POSTFIELDS is new
| From: | kalle@php.net | Date: | Sat, 23 Oct 2010 15:05:29 +0000 |
| Subject: | Doc #52331 [Opn->Csd]: Use of @ in CURLOPT_POSTFIELDS is new | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5381@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
Updated by: kalle@php.net
Reported by: dscotese at litmocracy dot com
Summary: Use of @ in CURLOPT_POSTFIELDS is new
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux/Windows I think
PHP Version: 5.3.2
-Assigned To:
+Assigned To: kalle
Block user comment: N
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.
Previous Comments:
------------------------------------------------------------------------
[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().
------------------------------------------------------------------------
[2010-07-26 08:07:12] dscotese at litmocracy dot com
Yes, that is what I'm referring to.
I'm also referring to this form of it:
<?php
curl_setopt($ch, CURLOPT_POSTFIELDS, "@/home/ross/photo.jpg");
?>
Note that in the second form, PHP expects the string to contain properly
encoded data. I'm not entirely sure if this second form is supported in
any version of PHP (as insinuated in my final paragraph). I also never
figured out how to post a comment but still honor php.net's request not
to document bugs in the comments, so I didn't post the apparent
requirement that the @-prefixed path be passed as an array. I believe
there are servers that want an XML file posted, but don't want it posted
as part of a name-value pair.
------------------------------------------------------------------------
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