owncloud / owncloud/android

Resuming chunked uploads

Open
#2,070 22 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Transfers
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

Steps to reproduce
  1. Prepare a big video files
  2. Upload big video files
  3. Disconnect from network
  4. Wait for error
  5. Connect again
  6. 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.

Related: https://github.com/owncloud/android/issues/1400

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.