Ebeo / google-gdata

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

DocListUploader-1.1: Fails to upload document #372

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Login to you Google Account (Documents are listed correctly)
2. Drag a valid file (sample RTF would do) to the Drag-and-Drop area

What is the expected output? What do you see instead?

The expected output would be the actual upload of the file, instead a popup
informs me the following message:

"Error, unable to upload the file: C:\<path to file>. Execution of request
failed: http://docs.google.com/feeds/documents/private/full"

What version of the product are you using? On what operating system?
OS: Windows XP SP3 (32bit), Windows 7 Professional (32bit), Windows Vista
Business (32bit).

Recently downloaded (2010-04-19) DocListUploader-1.1.exe, and the .Net
examples on the Google Document List Data API (2.0).

Please provide any additional information below.

Debugging the code I get the following innerException on the
GDataRequestException: 
"The remote server returned an error: (417) Expectation failed."

service.UploadDocument(filename, null) is the culprit, for some reason.

Original issue reported on code.google.com by brian.tani on 19 Apr 2010 at 6:28

GoogleCodeExporter commented 9 years ago
Update:
If before you call UploadDocument, you change the 
DocumentsListQuery.documentsBaseUri
from "http://docs.google.com/feeds/documents/private/full" to
"https://docs.google.com/feeds/documents/private/full" the upload now works.

lastUploadEntry = service.UploadDocument(filename, null);

This is not remarked on the documentation, however.

Original comment by brian.tani on 22 Apr 2010 at 1:31

GoogleCodeExporter commented 9 years ago
Probably the services changed and did not tell anyone. Will investigate.

Original comment by fman...@gmail.com on 26 Apr 2010 at 1:49

GoogleCodeExporter commented 9 years ago
That was probably a "mishap" inbetween. I did not try the old 1.1 download, but 
if you pull the latest version, i 
successfully worked with that all day without a problem. Can you verify with 
the latest .exe in the trunk?

Original comment by fman...@gmail.com on 26 May 2010 at 8:10

GoogleCodeExporter commented 9 years ago
I used the Google Document List Data API (2.0) - at least I think it was. 
Clicked on
the Download link on Client Libraries and Sample Code page, which pointed me to
Download page of the project. The version of the Google Data API Setup was 
1.4.0.2.

I checked out the latest code from the sample folder in the trunk, compiled and 
was
able to reproduce the problem.

It was my understanding that the trunk version of the Google Document List API 
was
the 3.0 still in development. Was I wrong in thinking that?

Anyways, I compiled the library from src (checked out from trunk). Changed the
reference on the DocListUploader from the 1.4.0.2 to the recently compiled 
version of
them (1.5.0.0). Compiled again, with no errors or warnings, and was able to 
reproduce
the apparent problem. 

Then I used the DLLs from the /trunk/client/cs/lib/Debug with the same result.

Again, changing the DocumentsListQuery.documentsBaseUri to
"https://docs.google.com/feeds/documents/private/full" before the upload made 
it work. 

Furthermore, I ran the DocListUploader.exe from the 
/trunk/client/cs/lib/Release with
the same result.

The test file were a 160KB RTF and 64KB plain text file.

I even uninstalled the the 1.4.0.2 SDK, prior to compiling/running the other 
tests.
Is there anything I'm missing?

I don't know if this is relevant or not, but I don't have a premium account. But
AFAIK this should work regardless.

Original comment by brian.tani on 26 May 2010 at 1:03

GoogleCodeExporter commented 9 years ago
I do not think there is anything you are missing, it just makes the problem 
harder to 
reproduce. As stated, it does not happen for me, so it could well be an 
account/server 
isntance issue. There is a trend to https here, so maybe they rolled something 
out, or 
something is just affecting a smaller set of users. Let me investigate 
somemore, or in 
the worst case, just change the uploader to use https by default.

Original comment by fman...@gmail.com on 7 Jun 2010 at 4:56

GoogleCodeExporter commented 9 years ago
I also facing the same problem.

Had been update my library to 1.5, and recompile. But still produce the same 
error as brian.

My OS is Windows 7 64bit and Window Server 2008, .Net Framework 4.

Had been tried brian's way of apply https, but not working too.

Wish to have an answer for it, thanks.

Original comment by v.han...@gmail.com on 14 Jun 2010 at 7:40

GoogleCodeExporter commented 9 years ago
I also have this issue. in xp. https and http are also crash.

Original comment by zhengjia...@gmail.com on 23 Nov 2010 at 12:07

GoogleCodeExporter commented 9 years ago
It's been a while since I looked at this issue, but if I remember correctly 
there was a problem using the HTTPS documentBaseUri as default. It only worked 
if I changed just before the UploadDocument. I don't remember if it was a 
problem with other parts of the code, or actually related to this issue. This 
is what my test code looked like for this problem. I have since moved on from 
this, but this may help you guys get it to work:
-----------------------------------------------------------------
//Using HTTPs to upload, because otherwise it doesn't work for any type of file.
//GoogleSamples uses HTTP, but it fails as it is now (DocListUploader 1.1).
string temp = DocumentsListQuery.documentsBaseUri;
DocumentsListQuery.documentsBaseUri = 
"https://docs.google.com/feeds/documents/private/full";

//UploadDocument is present on both API 2.0 and 3.0
//lastUploadEntry = service.UploadDocument(fileName, null);

Uri postUri = new Uri(DocumentsListQuery.documentsBaseUri);

ext = fileInfo.Extension.ToUpper().Substring(1);
contentType = (string)DocumentsService.GDocumentsAllowedTypes[ext];
if (contentType == null)
{
   throw new ArgumentException("File extension '" + ext + "' is not recognized as valid.");
}

lastUploadEntry = service.Insert(postUri, stream, contentType, fileInfo.Name) 
as DocumentEntry;

//Returns to what it was so we don't affect the rest of the service.
DocumentsListQuery.documentsBaseUri = temp;  
--------------------------------------------------------------------------
*UploadDocument ultimately uses Insert, so I was experimenting different ideas 
at the time.

Hope this helps.

Original comment by brian.tani on 23 Nov 2010 at 12:26

GoogleCodeExporter commented 9 years ago

Original comment by ccherub...@google.com on 18 Mar 2011 at 1:42

GoogleCodeExporter commented 9 years ago
DocListUploader has been updated to version 1.9 to match the newer version of 
the library and this issue should be over now.

Original comment by ccherub...@google.com on 27 Dec 2011 at 4:25