php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26587 multipart form post won't upload file
Submitted: 2003-12-10 15:12 UTC Modified: 2003-12-10 15:40 UTC
From: ed at epsit dot net Assigned:
Status: Not a bug Package: cURL related
PHP Version: 4.3.4 OS: XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ed at epsit dot net
New email:
PHP Version: OS:

 

 [2003-12-10 15:12 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-10 15:40 UTC] pollita@php.net
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 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC