cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: file upload

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 21 Jun 2009 22:58:12 +0200 (CEST)

On Fri, 19 Jun 2009, chandrakant gupta wrote:

> I am uploading file using CURLOPT_POST but my fine is not getting uploaded.
> plaese help.
>
> curl_easy_setopt(curl, CURLOPT_URL, "
> http://192.168.100.40//3108//ch_handoutadd.php");
> curl_easy_setopt(curl, CURLOPT_PORT, 80);
> curl_easy_setopt(curl, CURLOPT_VERBOSE ,1);
>
> result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS
> ,"file=winzip100.exe&id=AA48AT5R&connectedToJava=YES&uploadedfile=winzip100.exe&name=winzip100.exe");
> curl_easy_setopt(curl, CURLOPT_POST, 1);
> result = curl_easy_perform(curl);
>
> at server page is getting called but the file is not uploadded.

That's not a file upload, that's a chunk of data sent in a POST. You probably
want curl_formadd() and friends.

-- 
  / daniel.haxx.se
Received on 2009-06-21