Hello Tiago,

Thanks for replying.

I tried the way you said :

http://www.orkut.com/social/rpc?request=%5b%7b%22params%22%3a%7b%22groupId%22%3a%22%40self%22%2c%22userId%22%3a%22%40me%22%2c%22albumId%22%3a%224941124514%22%2c%22mediaItem%22%3a%7b%22title%22%3a%22aaa.jpg%22%2c%22url%22%3a%22%40field%3aimage1%22%7d%7d%2c%22method%22%3a%22mediaitems.create%22%7d%5d&oauth_token=1%2FGmzdIn1jvAbxQb71b4ayI0Q2yGr-CI0rOYmsYBYG8I8&oauth_consumer_key=XXXXXXXXXXXXXXXXXX&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1303224714&oauth_nonce=8043591&oauth_version=1.0&oauth_signature=vnMkRsg8g2nYlvfNI89Elh%2BZss0%3D

This is the URL I created with multipart/form-data request with one the part
as:
form-data;name=\"image1\";filename=\"uploaded\"

But still I get this response back:
{"error":{"message":"unauthorized: Authentication
failed.","code":401}}{"message":"badRequest: Invalid input - -1","code":400}

Can you help me out here? whats wrong with my request?

Regards,
Sarvesh


On Sat, Apr 16, 2011 at 9:53 AM, Tiago Silveira (Google) <t...@google.com>wrote:

> Hi, Sarvesh! I recently found that to successfully upload a photo you need
> to send a multipart request, but the JSON part of the request must go in the
> URL. So instead of:
>
> --part type:application/json --
> { method: 'mediaitems.create', ... }
> --part type:object/octet-stream --
> [BLOB]
>
> You move the request to the URL:
>
> /social/rpc?request=URLEncode("{method: 'mediaitems.create', ... }")
>
> This is how our client library does it:
>
> http://www.google.com/codesearch/p?hl=en#FfgKrVcptGg/java/src/com/google/orkut/client/api/BatchTransaction.java&q=upload%20addBody%20package:http://orkut-os-client%5C.googlecode%5C.com&l=118
>
> I've been scratching my head too. I imagine that our photo upload
> implementation predates the OpenSocial spec, and came at a time when Shindig
> didn't have multipart processing. But that's a conjecture, I was not there
> at the time.
>
> --
> You received this message because you are subscribed to the Google Groups
> "orkut Developer Forum" group.
> To post to this group, send email to opensocial-orkut@googlegroups.com.
> To unsubscribe from this group, send email to
> opensocial-orkut+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/opensocial-orkut?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en.

Reply via email to