cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

File Upload POST using libcurl

From: koderr <koderr_at_bk.ru>
Date: Sat, 8 Nov 2008 17:59:21 +0500

How I can do this:

curl -F upload=@localfilename -F press=OK [URL]

using libcurl?

Tried the following options:

curl_easy_setopt(curl_handle, CURLOPT_URL, szUrl);
curl_easy_setopt(curl_handle, CURLOPT_REFERER, szUrl);
curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, TRUE);
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, TRUE);
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, szPostData);
curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, TRUE);
curl_easy_setopt(curl_handle, CURLOPT_POST, TRUE);
curl_easy_setopt(curl_handle, CURLOPT_READDATA, fd);
curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback);
curl_easy_setopt(curl_handle, CURLOPT_COOKIE, szCookie);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, szAgent);

It does PUT with "Expect: 100-continue".

-- 
Best regards,
 koderr                          mailto:koderr_at_bk.ru
Received on 2008-11-08

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET