Resumable Transfers
After an interrupted upload, reselect the same file to resume. Device download stores a URL's content on the App device.
All of these use POST; /upload/chunk is multipart and the rest are forms. JSON responses use text/plain with no caching.
Endpoints
Chunked upload
- Compute the SHA-256 of the whole file and call
startwith a fixedid; when resuming the sameid,path,name,sizeandsha256must match. - The response contains
offset,completeandchunkSize(currently 4 MiB). - Send the next chunk at
offset, then callfinish; the server verifies SHA-256 before writing.
With parallel=true on start, the response also includes revision, chunks and threads (currently 4). chunks lists received chunk indexes; both chunk and finish must echo revision. Never rely on offset alone to decide whether parallel chunks are complete; if the revision changes, call start again for the state. Expired uploads return 404 鈥?reselect the original file to establish or restore the transfer.
Device download tasks
Every response contains the task id, name, path, state, total, downloaded, speed and error. Sizes are bytes and speed is bytes per second; an unknown total is -1. pause, resume and cancel must carry the same id, older ids return 409, and 404 when no task exists. Each App service runs one device download at a time; starting another while one runs returns 409.
Pause or cancel may first report pausing锛廯cancelling; keep querying until the final state. Only completedmeans done 鈥?checkerroronfailed. statuscan recover a lost task response, but task state is not guaranteed across App restarts. Download staging is managed by the App, and the file list hides the.tv-downloads` directory.