cURL / Mailing Lists / curl-library / Single Mail


Re: PHP curLib

From: ed <>
Date: Wed, 10 Dec 2003 11:23:11 -0500


Thanks for the reply:
I found the "curl-and-php" mailing list this morning and have been
reviewing it. No real help yet.

I have been playing around with the code and found some resolution.
The original example snipit I tried caused an execution error.
The cause turned out to be this statement:
     $sendvars['upfile'] = "@$logo";

Removing the quotes around @$logo corrected the error.
     $sendvars['upfile'] = @$logo; <== This cleared the error

The following code now sends as multipart, but I still don't get my file
to go.

$url = "http://design/uyoffice/test/testrcv.php";
$logo = "logo.gif";

$sendvars['fname'] = "John";
$sendvars['lname'] = "Smith";
$sendvars['upfile'] = @$logo;

$result = curl_exec($ch);

the content type shows as:
so I am now geting multipart submittal.

My handler now has the following variable results.
$fname = John
$lname = Smith
$upfile = logo.gif <= should reflect the temp
file address
$upfile_name = null <= should reflect the file name
$upfile_type = null <= should reflect the mimetype

I am still stuck with a file name coming across, not the file itself.


Daniel Stenberg wrote:

>On Tue, 9 Dec 2003, ed wrote:
>>Help!!! curl newbie in deep!!!
>No need to cross-post. Besides, you missed the most important mailing list for
>you: curl-and-php.
>>$sendvars['fname'] = "John";
>>$sendvars['lname'] = "Smith";
>>$sendvars['upfile'] = "@$logo";
>>foreach($sendvars as $key=>$value)
>This looks very odd. Is this really the documented way to do multipart
>formposts using the PHP/CURL interface?

This email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now!
Received on 2003-12-10