6 messages in com.googlegroups.google-picasa-data-apiRe: Upload photo fail with error 400 ...| From | Sent On | Attachments |
|---|---|---|
| Pong | 16 Mar 2008 12:06 | |
| Jeff Fisher (Google) | 17 Mar 2008 11:15 | |
| Anna G | 17 Mar 2008 14:54 | |
| Pong | 18 Mar 2008 20:32 | |
| Jeff Fisher (Google) | 19 Mar 2008 11:03 | |
| Pong | 20 Mar 2008 09:05 |
| Subject: | Re: Upload photo fail with error 400 and 500![]() |
|---|---|
| From: | Pong (atcu...@gmail.com) |
| Date: | 03/18/2008 08:32:54 PM |
| List: | com.googlegroups.google-picasa-data-api |
Hi Jeff,
I have tried to post a request without meta-data, but still getting "500 Internal Server Error" - ProtocolError. Note that I follow exactly the steps in Picasa Web Albums Data API - Developer's Guide: The Protocol (http://code.google.com/apis/picasaweb/ developers_guide_protocol.html), but it is still not workable as documented.
Following is the content that I post to remote server:
-------------------- Content-Type: image/jpeg Content-Length: 1092 Slug: sample.jpg
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…† ÆŠÄ2€ŒpH«¶Úpy•6¯ùY.%™•ÜD#ÎæŽ"ÁsØ×U§\i–»Ì2]A#ŽRXD
--------------------
Note that binary image is snipped out, and "Content-Length" was added into the post content but still not getting expected result :(
Regards, Pong
On Mar 18, 2:15 am, "Jeff Fisher (Google)" <api....@google.com> wrote:
Hi Pong,
I'm fairly certain Content-Length is required unless you're doing chunked encoding (at least according to the HTTP spec.)
Let's try to tackle this one at a time. Can you send me your full request (feel free to snip out the binary image contents again) of a POST without meta-data? Please include all of the headers you are sending. I'd like to see if I can replicate the "400 ProtocolError" message you are receiving.
Cheers, -Jeff
On Mar 16, 12:06 pm, Pong <atcu...@gmail.com> wrote:
Hi,
In Sep 2007, I had written a class in C# (.Net 2.0) to upload photo with metadata from my website and it works fine. However, I realize that it is not working recently. I tried two ways but both are getting errors from the remote server:
1. Bad Request (400) - Upload with metadata 2. Internal Server Error (500) - Upload without metadata
Can someone give me a hand on this?
Following is the content (with metadata) that I post to remote server:
-------------------- Content-Type: multipart/related; boundary="END_OF_PART" MIME-version: 1.0
--END_OF_PART Content-Type: application/atom+xml
<entry xmlns='http://www.w3.org/2005/Atom'> <title>sample.jpg</title> <summary>sample photo</summary> <category scheme="http://schemas.google.com/g/2005#kind" term="http:// schemas.google.com/photos/2007#photo"/> </entry> --END_OF_PART
Content-Type: image/jpeg
�? JFIF ` ` � Exif II* � C 2! !22222222222222222222222222222222222222222222222222� "
� ? } !1A Qa "q 2��?#B�� R��$3br? %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������ ������������������������������? --END_OF_PART--
--------------------
For readability, I have trimmed the binary image data. I did not include the "Content-Length" here as the class was working perfectly without it last time. Recently, no matter I post data with / without it and I am still getting error 400 with status "ProtocolError".
Some info for you: - Photo: A JPEG file. - App: Web application (ASP.NET 2.0 in C#) - MIME content: multipart/related (configured in WebRequest) - Method: POST (configured) - Auth: Use AuthSub authentication system with a valid session token. Authorization header is added before posting.




