Jeff-Lewis / google-gdata

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

DocumentsService.Upload file not able to upload PDF,Docx in dot net library. #548

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a DocumentsServiceObject
2.Call Uploadfile with convert = False.
3.Exception happens

following is the code
 FileInfo info = new FileInfo(<filePaths>);
                string str = info.Extension.ToUpper().Substring(1);
                string contentType = (string)DocumentsService.DocumentTypes[str];
                DocumentsService myService = new DocumentsService("TestGdoc");
                myService.setUserCredentials(<username>, <password>);
                myService.UploadFile(filePaths[0], "test", contentType, false);

The exception details.
innerexception -{"The remote server returned an error: (403) Forbidden."}
Message -Execution of request failed: 
https://docs.google.com/feeds/default/private/full?convert=false
ResponseString -<errors 
xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>Serv
iceForbiddenException</code><internalReason>Files must be uploaded using the 
resumable upload mechanism.</internalReason></error></errors>

Windows xp 32 bit OS.

For PDF even with convert =true it is failing.

Original issue reported on code.google.com by TestUser...@gmail.com on 18 Oct 2011 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by ccherub...@google.com on 18 Oct 2011 at 4:49