Jeff-Lewis / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

download a file using resource id #609

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to download a "file" from a specific folder in gdocs, but error 404 
returned.  
//*************************************************
Uri documentUri = new 
Uri("https://docs.google.com/feeds/download/image/jpeg/Export?docID=0B6RN_KkDdkR
6aFk&exportFormat=jpeg");

//Uri documentUri = new Uri(entry.Content.Src.Content);

                    HttpWebRequest webRequest = (HttpWebRequest)
                    HttpWebRequest.Create(documentUri);
                    GDataGAuthRequestFactory factory=(GDataGAuthRequestFactory)
                    service.RequestFactory;

                    webRequest.Headers.Add("Authorization", "GoogleLogin auth=" + factory.GAuthToken);

                    HttpWebResponse webResponse = (HttpWebResponse)
                    webRequest.GetResponse();

//************************************************

i want to download a file using its resourceId. could you please give a 
solution for it.
thanks and regards..

Original issue reported on code.google.com by kkumar....@gmail.com on 12 Jul 2012 at 11:54

GoogleCodeExporter commented 9 years ago
Clients should not construct the download URL manually, but instead only modify 
the content link provided in the entry to add a download format as described in 
the docs:

https://developers.google.com/google-apps/documents-list/#downloading_documents_
and_files

To download a file, you retrieve it first constructing a query object and then 
use its content link.

Original comment by ccherub...@google.com on 12 Jul 2012 at 4:08