#26587 [Opn->Bgs]: multipart form post won't upload file
| From: | pollita@php.net | Date: | Wed, 10 Dec 2003 20:40:25 +0000 |
| Subject: | #26587 [Opn->Bgs]: multipart form post won't upload file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51943@lists.php.net to get a copy of this message | ||
ID: 26587
Updated by: pollita@php.net
Reported By: ed at epsit dot net
-Status: Open
+Status: Bogus
Bug Type: cURL related
Operating System: XP
PHP Version: 4.3.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Hint: CURLOPT_UPLOAD
Previous Comments:
------------------------------------------------------------------------
[2003-12-10 15:12:07] ed at epsit dot net
Description:
------------
This appears to be a re-accurance of bug 14320.
Attempting to upload image file using libcurl http multipart post. All
I get is the file name stuffed into the variable I would expect the
temporary file path to be in. No file is uploaded.
OS - Windows XP
Apache/2.0.47 (Win32)
PHP Version 4.3.4
libcurl/7.10.5 OpenSSL/0.9.7b zlib/1.1.4
Reproduce code:
---------------
<?php
// Sample from PHP Bug report # 14320
$url = "http://design/uyoffice/test/testrcv.php";
$upfile = "logo.gif";
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_HEADER,1);
curl_setopt($ch,CURLOPT_VERBOSE,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,"1");
curl_setopt($ch, CURLOPT_POSTFIELDS, array('upfile'=>@$upfile));
$result = curl_exec($ch);
curl_close($ch);
?>
Expected result:
----------------
Expect to have image file uploaded to server,
with appropriate PHP variable _FILES["upfile"]
array available for file manipulation.
Actual result:
--------------
No file is uploaded. Instead, I get variable $upfile containing the
file address that was to be uploaded.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26587&edit=1