Hi all !

My code :
------------------------------------------------------------------------------------------------------------------------------------
ifstream in("/tmp/02.jpg", ios::in | ios::binary);
buffer = new char [size];
file.read (buffer, size);

curl_easy_setopt(curl, CURLOPT_URL, url); // I check url ok
headers = curl_slist_append(headers, "Content-type:image/jpeg");
headers = curl_slist_append(headers, auth); // I check auth ok
headers = curl_slist_append(headers, sHeader2.data());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_formadd(&post, &last, CURLFORM_COPYNAME, "",CURLFORM_FILE, "/
tmp/
02.jpg" , CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer );
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);   // ((-s/--
silent)  //no progressive
res  = curl_easy_perform(curl);  /* post away! */
------------------------------------------------------------------------------------------------------------------------------------

But when perform above code . It's not OK. Image is stored in USB
device, device is mounted

When I perform commamd line :
curl --silent --request POST --data-binary "@/tmp/02.jpg" --header
"Slug: Photo 02" --header "Content-Type: image/jpg" --header
"Authorization: GoogleLogin auth=myautho" "http://
picasaweb.google.com/
data/feed/api/user/IDmyuser/albumid/IDAlbum1"
It's OK. I checked.


I can't understand '--data-binary' option.
use curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer ); with buffer
is
read binary, it's Ok ?


My program with C++/Linux, lib curl 7.19.5

I'm looking forward to your help.


Thanks and regards,
Nguyen !


-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en.

Reply via email to