Re: HTML form upload works, CURL fails when uploading file from c:

From: Date: Sat, 05 Jan 2008 23:57:20 +0000
Subject: Re: HTML form upload works, CURL fails when uploading file from c:
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-266815@lists.php.net to get a copy of this message
Well, <dope slap> I think I understand the problem now: CURL is operating from the server so it knows nothing about C: on the client! So how do I solve my problem? I want to upload multiple files from C: to the server based on a single wildcard spec typed into an HTML form by the user. John Gunther wrote:
PHP 5.2.1 on Apache/Linux. Client is Firefox and IE7 on Windows XP. Uploading C:\boot.ini works great from an HTML type="file" form element but fails using what should be the equivalent: curl_setopt($ch,CURLOPT_POSTFIELDS,array('peru'=>'@C:/boot.ini')); CURL error is "failed creating formpost data". Same CURL works when the test file resides on the PHP server: curl_setopt($ch,CURLOPT_POSTFIELDS,array('peru'=>'@/home/user/boot.ini')); so problem seems to be in the '@C:/boot.ini' filespec. Substituting '@C:\boot.ini' or '@C:\\boot.ini' doesn't help. What am I doing wrong?


« previous php.general (#266815) next »