Doc #52331 [Com]: Use of @ in CURLOPT_POSTFIELDS is new

From: Date: Mon, 26 Jul 2010 00:13:32 +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-4736@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: ross@php.net Reported by: dscotese at litmocracy dot com Summary: Use of @ in CURLOPT_POSTFIELDS is new Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Linux/Windows I think PHP Version: 5.3.2 Block user comment: N New Comment: 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/...". Previous Comments: ------------------------------------------------------------------------ [2010-07-13 21:45:38] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52331&edit=1

« previous php.doc.bugs (#4736) next »