Answer the question
In order to leave comments, you need to log in
Loading RAR and ZIP archives via Google Documents List Data API v3.0 using .NET
Does anyone know if it's possible to upload archives via the API? An error occurs when using the code from the code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/DocListUploader/HiddenForm.cs example . Although, on the other hand, you can download archives using a browser.
Answer the question
In order to leave comments, you need to log in
The answer is yes you can. You just need to upload via ResumableUploader. Here is an example:
var service = new GoogleDocument("email", "password");
ClientLoginAuthenticator cla = new ClientLoginAuthenticator("111",
ServiceNames.Documents,service.Credentials);
ResumableUploader ru = new ResumableUploader();
// Set metadata for our upload.
Document entry = new Document();
entry.Title = "My Archive.zip";
entry.MediaSource = new MediaFileSource("c:\\111.zip", "application/octet-stream");
// Add the upload uri to document entry.
Uri createUploadUrl =
new Uri("https://docs.google.com/feeds/upload/create-session/default/private/full");
AtomLink link = new AtomLink(createUploadUrl.AbsoluteUri);
link.Rel = ResumableUploader.CreateMediaRelation;
entry.DocumentEntry.Links.Add(link);
ru.Insert(cla, entry.DocumentEntry);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question