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

[WIP] Read binary files in chunks #536

Closed
wants to merge 4 commits into from

Conversation

blink1073
Copy link
Contributor

Fixes #96.

I verified this works with a 340MB file (that crashed in the previous version), and also still works with .ipynb files.

@blink1073 blink1073 changed the title Read binary files in chunks [WIP] Read binary files in chunks Oct 6, 2015
@blink1073
Copy link
Contributor Author

Well, almost works, the files are corrupted, I'll try again tomorrow...

@blink1073
Copy link
Contributor Author

This solves the upload portion, but not the download back to the server portion. We need to support a similar chunked protocol on the XHR end.

@blink1073
Copy link
Contributor Author

When we save() a file, we could send the size as part of the first call to /api/contents/ PUT, then send the blobs after.

@blink1073
Copy link
Contributor Author

A similar protocol would be needed for get() to support large file download.

@ellisonbg
Copy link
Contributor

@blink1073 do you think this is stable enough to consider for 4.1?

@ellisonbg ellisonbg added the bug label Oct 12, 2015
@ellisonbg ellisonbg modified the milestones: 4.1, 4.2 Oct 12, 2015
@ellisonbg
Copy link
Contributor

Verbally "no" so marking as 4.2

@tritemio
Copy link
Contributor

This is an important feature for me. I'm using the upload for an online demo to convert data files to a standard format.

If there is something I can do to help to speed up the inclusion of this feature I'd be glad to help.

@blink1073
Copy link
Contributor Author

I think the simplest way would be to add an optional chunks_remaining field to the REST API model and use the existing base64 encoding. Then you would call save with each chunk from notebooklist.js. The server would have to be updated to detect the presence of chunks_remaining, and keep a file handle open until chunks_remaining is zero. Thoughts?

@takluyver
Copy link
Member

Is it worth looking for existing solutions? Uploading a large file over HTTP isn't that unusual, is it?

@blink1073
Copy link
Contributor Author

From what I've gathered in searching, the consensus is to use the HTML5 FileReader API using binary chunks. There are uploader libraries that handle the chunking/resuming, but we also need to stream downloads from the server. Either way, we'd have to implement the logic on the server to handle streaming.

@minrk minrk modified the milestones: 4.3, 4.2 Apr 7, 2016
@minrk minrk mentioned this pull request May 31, 2016
@Carreau
Copy link
Member

Carreau commented Jun 21, 2016

That has gone stale, I'm going to close to keep the active PR queue short, and tag with "Closed PR" so that we can reopen when needed. Thanks a lot @blink1073 for getting that started .

@Carreau Carreau closed this Jun 21, 2016
@Carreau Carreau modified the milestones: no action, 4.3 Aug 1, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uploading large files crashes the browser
6 participants