koderr
2008-11-08 12:59:21 UTC
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".
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:***@bk.ru
Best regards,
koderr mailto:***@bk.ru