cURL / Mailing Lists / curl-library / Single Mail

curl-library

LibCURL PUT Question...

From: Casey O'Donnell <caseyodonnell_at_hotmail.com>
Date: Wed, 26 May 2004 12:34:08 -0500

I've been attempting to use LibCURL (also read, "I am a newbie to LibCURL.")
to implement HTTP GET and PUT functionality in my application. I've gotten
GET to work effectively, but have had some trouble with PUT. I get a valid
return code from curl_easy_perform(pCurl);

pFile = fFile.fp(); // Already opened FP

pCurl = curl_easy_init();

if(pCurl && pFile)
{
        curl_easy_setopt(pCurl, CURLOPT_READFUNCTION, myread_callback);
        curl_easy_setopt(pCurl, CURLOPT_UPLOAD, TRUE);
        curl_easy_setopt(pCurl, CURLOPT_PUT, TRUE);
        curl_easy_setopt(pCurl, CURLOPT_URL, szDest); // something like
"http://idisk.mac.com/bobbuilder/Sites/test.html"
        curl_easy_setopt(pCurl, CURLOPT_READDATA, pFile);
        curl_easy_setopt(pCurl, CURLOPT_INFILESIZE_LARGE, fFile.Length());
        curl_easy_setopt(pCurl, CURLOPT_USERPWD, szUserPass);
        curl_easy_setopt(pCurl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
        res = curl_easy_perform(pCurl);

        curl_easy_cleanup(pCurl);
}

I'm testing with a .Mac iDisk account, and it appears to be working, yet no
files are uploaded. I'm using the same read callback as in the HTTPUT
example source code. Am I missing something here? I've actually tried
placing break-points in my call-back, yet they are never tripped, so I
suspect that it isn't actually making it into that section of the code
(explaining the failed upload).

Thanks for any insight.

Casey

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Received on 2004-05-26