Resuming chunked uploads
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.2k
- Forks
- 3.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
Steps to reproduce
- Prepare a big video files
- Upload big video files
- Disconnect from network
- Wait for error
- Connect again
- Wait
Expected result
Upload resumes from last starting point (takes less time)
Actual result
Upload does not resume (see https://github.com/owncloud/android/issues/2069) or would restart transfer from scratch.
Versions
Android app 2.5.0
Android 5.1.1
The mobile app should use the new chunking endpoint:
- MKCOL http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/
- PUT chunk 1 to http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/0
- PUT chunk 2 to http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/1
- PUT chunk 3 to http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/2
- ...
- PUT chunk 999 to http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/1000 (the chunk number can be any number but must be integer and the order must be correct)
- MOVE http://localhost/owncloud/remote.php/dav/uploads/$userId/$transferId/.file to Destination: remote.php/dav/files/$userId/target/path/finalfile.dat
The idea is to just resume uploading the failed chunks and assume the other chunks are still on the server.
Beware that if no chunk upload is happening within more than 2 days, the transfer folder will not exist any more and old chunks are deleted. So if you get a 404 on PUT, assume the transfer was cancelled and start over.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin at the Android upload flow that handles chunked transfers and inspect the MKCOL, PUT, and MOVE endpoint sequence described in the issue, including the 404-after-two-days case. Use issues 2069 and 1400 as context; done means interrupted uploads continue from surviving chunks and restart only when the transfer folder is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100