Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resuming an interrupted upload #897

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 3 comments
Open

Unable to resuming an interrupted upload #897

GoogleCodeExporter opened this issue Mar 15, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link
Collaborator

google-api-java-client-1.18.0-rc
google-api-services-drive-v2-rev135-1.18.0-rc

Java environment: Android 443

Describe the problem.

It seems that MediaHttpUploader.upload() did not handle resume upload well. 
The reason is that "1) Request the upload status." mentioned in "Google Drive 
SDK, Upload Files" always fail to get "Content-Range".
https://developers.google.com/drive/web/manage-uploads#resumable

My test step is try to disconnect WiFi/connect to another WiFi during upload, 
and then upload the same file again, but it always upload the file from 
beginning.

Code(cannot resume an interrupted upload):

insert = getDriveService().files().insert(fileMetadata, mediaContent);
MediaHttpUploader mediaUploader = insert.getMediaHttpUploader();
mediaUploader.setDirectUploadEnabled(false);
mediaUploader.setProgressListener(mUploadFileProgressListener);
mediaUploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE);
mediaUploader.upload(insert.buildHttpRequestUrl());


How would you expect it to be fixed?

1) Google drive server should respond "Content-Range" with "HTTP/1.1 308 Resume 
Incomplete"
2) If server is allow to NOT response "Content-Range", the way to solve it is 
polling "Content-Range" all the time during upload. Thus, it able to resuming 
an interrupted upload by "Resume the upload from the point where it left off."


Original issue reported on code.google.com by kaifu.c...@gmail.com on 15 Aug 2014 at 8:18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant