What does the gen_multipart method look like?
On Jan 28, 2014 11:01 PM, "Sridhar Arumugam" <sridh...@infratab.in> wrote:

> its not working for me.without meta data its working.
> but i need to upload a image with meta data..
>
> On Tuesday, January 28, 2014 12:33:46 PM UTC+5:30, Mike Erickson wrote:
>>
>> It looks like you're using code similar to this Stack Exchange question.
>> Did their solution work for you?
>>
>> http://stackoverflow.com/questions/8262266/xmlhttprequest-multipart-
>> related-post-with-xml-and-image-as-payload
>> On Jan 27, 2014 10:56 PM, "Sridhar Arumugam" <srid...@infratab.in> wrote:
>>
>>> 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 google-picasa-data-api+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-pica...@googlegroups.com.
>>> Visit this group at http://groups.google.com/
>>> group/google-picasa-data-api.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
> 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 google-picasa-data-api+unsubscr...@googlegroups.com.
> To post to this group, send email to
> google-picasa-data-api@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-picasa-data-api.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 google-picasa-data-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-picasa-data-api@googlegroups.com.
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