3 messages in com.googlegroups.google-picasa-data-apiRe: Upload photo: PhotoService insert...
FromSent OnAttachments
pdt...@gmail.com12 Dec 2007 00:44 
pdt...@gmail.com15 Dec 2007 09:12 
Ryan Boyd (Google)16 Dec 2007 10:19 
Subject:Re: Upload photo: PhotoService insert gives error: 415 Unsupported Media type
From:pdt...@gmail.com (pdt@gmail.com)
Date:12/15/2007 09:12:22 AM
List:com.googlegroups.google-picasa-data-api

Can someone please help me?

Hello, I am trying to upload a photo to my album using this code:

Uri uri = new Uri("http://picasaweb.google.com/data/feed/api/user/ <username>/album/<albumname>"); PicasaService service = new PicasaService("<appname>"); service.setUserCredentials("<user>", "<pass>"); MessageBox.Show(service.QueryAuthenticationToken()); Google.GData.Client.FeedQuery query = new Google.GData.Client.FeedQuery(uri.ToString()); PicasaFeed feed = (PicasaFeed)service.Query(query); try { if (feed != null) { PicasaEntry album = (PicasaEntry)feed.Entries[0]; Uri posturi = new Uri(album.FeedUri.ToString()); FileStream fs = File.OpenRead("d:/minimize.jpeg"); PicasaEntry entry = (PicasaEntry)service.Insert(posturi, fs, "image/jpeg", "minimize.jpeg"); entry.Title.Text = "MyImageTitle"; entry.Summary.Text = "MyImageSummary";

PicasaEntry updated = (PicasaEntry)entry.Update(); } }

I am getting the 415 exception. I read earlier thread about the file size, but I am getting same error even for files smaller than 2kb.

Please help! Thanks,