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

Resumable uploads #45

Open
wavexx opened this issue Jul 14, 2017 · 0 comments
Open

Resumable uploads #45

wavexx opened this issue Jul 14, 2017 · 0 comments
Milestone

Comments

@wavexx
Copy link
Member

wavexx commented Jul 14, 2017

All the kids in the block are doin' it, but we want to do it right™.

Resumable uploads require a FileReader object so only work with JS. As such, we can implement the REST backend only, with JS support augmenting the current "autoprogress" form wrapper.

Basic concept:

  • Login or grant ID is required to create an upload session id.
  • To open the session, you need to announce file list, file sizes and file names.
  • Once initialized, an upload session pre-allocates the storage
  • The REST api should allow to write a chunk of binary data given the triplet: upload ID, file index, byte range.
  • The upload session should have a very short TTL (~30m idle max)

We can then modify the web forms and REST interface so that file uploads can either accept form uploads or an upload session ID. If the upload SID is given, we just move the files into place and handle it exactly as it's being done now.

On the client side, if FileReader is supported, we remove the object from the DOM and handle the upload outself as above, by chunking the files into small blocks and uploading them using vanilla POST requests. The server is oblivious about the chunking, as long as the addressing triplet is valid. Once the files are uploaded, we inject an hidden input field in the form with the upload SID and proceed normally.

@wavexx wavexx added this to the 1.0 milestone Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant