I tried to insert new image to google-picasa album using Gdata api 
authenticate via oauth2.0 from request.js node.js module.

*My Function:*

insertPhoto(options,callback){
    fs.readFile('C:/Users/Public/Pictures/Sample 
Pictures/Chrysanthemum.jpg',"base64",function(error,data){
        var userId=options.userId || 'default';
        var 
rootUrl='https://picasaweb.google.com/data/feed/api/user/'+userId+'/albumid/'+options.albumId+'';
        var body_data=gen_multipart('testing.jpg','sss',data,'image/jpeg');
        request({
            method:'POST',
            headers:{ 'GData-Version': '2','Authorization':'Bearer' + ' ' + 
'my_access_token',"Content-Type":'multipart/related; 
boundary="END_OF_PART"','Content-Length':body_data.length,"MIME-version":"1.0"},
            body:body_data,
            uri:rootUrl
        },callback);    
    });   }


*Passing options and callback to my function*

insertPhoto({albumId:'5917473565459053457'},function(error,success){
    if(error){
        console.log(error);
    }else{
        console.log(success);
    }});


*The following is my output*

{ status: 400, message: 'Not an image.' }

Not an image.

what error is this my header and request body which i made is same as in 
google documentation.

refer: 
https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol#PostPhotos

what i did wrong can any one help me!!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-picasa-data-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to