EsrefDurna / google-gdata

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

Resource not found (#404) on DocumentsRequest.Download #578

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When calling Download on DocumentsRequest, the request fails with a not found 
(#404) error instead of returning the stream.

This is because the download URL is mangled by the 
BuildDocumentPartialExportUrl method when concatenating the exportFormat type. 
A correct download URL would be:
https://docs.google.com/feeds/download/spreadsheets/Export?key=KEY&exportFormat=
csv&gid=0
while the URL generated looks like:
https://docs.google.com/feeds/download/spreadsheets/Export?key=KEYcsv&gid=0

This can be easily fixed by changing line 657 in docrequest.cs from:
if (!baseUrl.Contains("/export")) {
to
if (!baseUrl.ToLowerInvariant().Contains("/export")) {

Valid for revision r1164.

Original issue reported on code.google.com by lorenz.klopfenstein on 15 Mar 2012 at 4:51

GoogleCodeExporter commented 8 years ago
Thanks, added your patch in rev. 1165:

http://code.google.com/p/google-gdata/source/detail?r=1165

Original comment by ccherub...@google.com on 15 Mar 2012 at 9:25