|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-13 21:45 UTC] dscotese at litmocracy dot com
Description: ------------ The CURLOPT_POSTFIELDS option supports the use of @ to indicate that a file should be sent as part of the post data, but the documentation does not specify what is the earliest version that supports this feature. I believe that my version of PHP does not support the use of the @ sign at the beginning of a data value in CURLOPT_POSTFIELDS, but because the documentation makes it seem like it has always been there, I can't verify this. I have PHP 5.1.2 in production (we're chickens when it comes to upgrading), but 5.2.5 on my dev machine (running XAMPP). In the XAMPP 5.2.5 version, the @ feature only works if the POST data is passed as an array. That should be in the docs too. I'm adding some comments for future readers. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 12:00:01 2026 UTC |
Not entirely sure of the bug here, are you referring to something like this: <?php curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => "@/home/ross/photo.jpg")); ?> Are you including the @ inside the string quotes? @ can also be used to suppress error output, which might be confusing PHP if you have it like so: @"/home/ross/...".