Download your DocList arbitrary file uploads in .NET


The .NET client's Download() method currently handles exporting documents, presentations, and spreadsheets. However, it cannot download PDFs or arbitrary file types. Those types cannot be exported to different formats. Instead, you need to override the Download() method in docsrequest.cs to hit the content src link:

public Stream Download(Document document) {
  string queryUri = "";
  Service s = this.Service;

  string downloadUrl = document.DocumentEntry.Content.Src.ToString();
  Uri target = new Uri(downloadUrl);

  return s.Query(target);
}

2 comments:

prashanthi said...

I am not able to download the documents from google docs. The response stream what it is returning does not contain the contents of the document instead it is returning me the httprequest sent.Can anyone please let me know how to download in c#.

Wonderful Jewelry said...

fashion jewelry wholesale
wholesale fashion jewelry
china jewelry wholesale
china fashion jewelry
jewelry wholesale china
fashion jewelry china
wholesale jewelry
jewelry wholesale