gauravtyagi2777 / google-gdata

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

ResumableUploader doesn't appear to do anything #407

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The method I'm using for uploading PDFs is this:

int CHUNK_SIZE = 10485760;

ClientLoginAuthenticator cla = new ClientLoginAuthenticator(
                    "Dokix-PDFScanPro-v1", ServiceNames.Documents, username, password);

// Set up resumable uploader and notifications
ResumableUploader ru = new ResumableUploader(CHUNK_SIZE);
ru.AsyncOperationCompleted += new 
AsyncOperationCompletedEventHandler(ru_AsyncOperationCompleted);
ru.AsyncOperationProgress += new 
AsyncOperationProgressEventHandler(ru_AsyncOperationProgress);

// Set metadata for our upload.
Document entry = new Document();
entry.Title = textBoxDocumentName.Text;
entry.MediaSource = new MediaFileSource(fileName, "application/pdf");

// Add the upload uri to document entry.
Uri createUploadUrl = new 
Uri("https://docs.google.com/feeds/upload/create-session/default/private/full");
AtomLink link = new AtomLink(createUploadUrl.AbsoluteUri);
link.Rel = ResumableUploader.CreateMediaRelation;
entry.DocumentEntry.Links.Add(link);

ru.InsertAsync(cla, entry.DocumentEntry, new object());

The ru_AsyncOperationProgress method is called about once or twice a second, 
always with zero percent complete, the ru_AsyncOperationCompleted method is 
never called.

Original issue reported on code.google.com by timhaugh...@gmail.com on 19 Jul 2010 at 8:03

GoogleCodeExporter commented 8 years ago
Hey Tim,

We'll take a look at this for you.

Cross-reference: 
http://www.google.com/support/forum/p/apps-apis/thread?tid=3f1b8ccaefe0e4eb&hl=e
n

Thanks,
Vic

Original comment by vicfry...@google.com on 27 Aug 2010 at 5:14

GoogleCodeExporter commented 8 years ago
Hi Vic,

Any update on this bug?

Thanks,
Andrew

Original comment by andrew.f...@gmail.com on 4 Oct 2010 at 10:01

GoogleCodeExporter commented 8 years ago
Weird, I was sure I'd posted an update.

For some reason, the chunk size specified in the sample code doesn't work for 
Google Docs, I haven't looked into why. I dramatically reduced the chunk size 
and it seemed to work from then on.

Original comment by timhaugh...@gmail.com on 5 Oct 2010 at 8:12

GoogleCodeExporter commented 8 years ago
Thanks for your reply, Tim.

After some playing, I've dropped the chunk size to 3300 bytes and all is 
reliable.

Original comment by andrew.f...@gmail.com on 5 Oct 2010 at 8:47

GoogleCodeExporter commented 8 years ago
Hi Tim,

Looking at the source code and a Wireshark capture, it doesn't actually do 
resumable uploading with small chunks.  

Resumableupload.cs looks like its unfinished and partly tested.
I've opened an issue here:
http://code.google.com/p/google-gdata/issues/detail?id=431

Andrew

Original comment by andrew.f...@gmail.com on 7 Oct 2010 at 12:39

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 8 Nov 2010 at 4:23