We have a working Picasa class to upload photos.

We have been trying to upload videos the same way but have been getting the 
error: A direct media post of videos is currently not supported.

According to 
https://developers.google.com/picasa-web/docs/3.0/developers_guide_protocol#PostVideo
 
one could use supported MIME type and upload videos the same way as photos.

As you can see in this method, we provide the correct MIME type: 
https://github.com/ShareX/ShareX/blob/master/ShareX.UploadersLib/ImageUploaders/Picasa.cs#L190

        public override UploadResult Upload(Stream stream, string fileName)
        {
            if (!CheckAuthorization()) return null;
            if (string.IsNullOrEmpty(AlbumID))
            {
                AlbumID = "default";
            }
            UploadResult ur = new UploadResult();
            string url = 
string.Format("https://picasaweb.google.com/data/feed/api/user/default/albumid/";
 
+ AlbumID);
            string contentType = Helpers.GetMimeType(fileName);
            NameValueCollection headers = GetAuthHeaders();
            headers.Add("Slug", URLHelpers.URLEncode(fileName));
            ur.Response = SendRequest(HttpMethod.POST, url, stream, 
contentType, null, headers);
            if (ur.Response != null)
            {
                XDocument xd = XDocument.Parse(ur.Response);
                XElement entry_element = xd.Element(AtomNS + "entry");
                if (entry_element != null)
                {
                    XElement group_element = entry_element.Element(MediaNS 
+ "group");
                    if (group_element != null)
                    {
                        XElement content_element = 
group_element.Element(MediaNS + "content");
                        if (content_element != null)
                        {
                            ur.ThumbnailURL = 
content_element.GetAttributeValue("url");
                            int last_slash_index = 
ur.ThumbnailURL.LastIndexOf(@"/");
                            ur.URL = 
ur.ThumbnailURL.Insert(last_slash_index, @"/s0");
                        }
                    }
                }
            }
            return ur;
        }
    }
    public class PicasaAlbumInfo
    {
        public string ID { get; set; }
        public string Name { get; set; }
        public string Summary { get; set; }
    }


When debugging, I can see for an mp4 file, we have" contentType = 
"video/mp4" This must be supported as per the Picasa Web Albums Data API 
guidelines.


Any help would be much appreciated.


Thanks in advance 

Michael

-- 
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 https://groups.google.com/group/google-picasa-data-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to