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

[FEATURE] support large files #163

Open
sokoow opened this issue Feb 28, 2023 · 2 comments
Open

[FEATURE] support large files #163

sokoow opened this issue Feb 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@sokoow
Copy link

sokoow commented Feb 28, 2023

Description

Support large files - currenctly when I try to upload anything more than > 40 megs, my browser would hang with SIGILL . Is it possible to support files larger than 1GB?

Screenshots

No response

Additional information

No response

@sokoow sokoow added the enhancement New feature or request label Feb 28, 2023
@bjarneo
Copy link
Member

bjarneo commented Feb 28, 2023

Did not see this one until now. So, that is a great question. Since the encryption is done by tweetnacl in the browser, it is using browser resources. I have to play around and test to see what is possible or not. Find the bottleneck.

@sokoow sokoow changed the title [FEATURE] <description> [FEATURE] support large files Mar 1, 2023
@bjarneo
Copy link
Member

bjarneo commented Mar 12, 2023

It requires a lot of refactoring to make this work.

By default everything was base64 encoded (after the encryption to make it easy to post to the server), which works fine for normal text, but not large files

What has to be done is

  1. use this API in the zip.js file: reader.readAsArrayBuffer(file); (place it next to new FileReader()
  2. Remove encode base64 from zipFiles function
  3. Update both encrypt and decrypt in the crypto.js file to not use base64encode or decode for files
  4. It has to be handled differently by the upload, currently it is stringified form data added to a POST request in the api/secrets.js#createSecret() function
  5. Handle streaming of large files to the server in a fine way

So, TL;DR: The current file handling is very bad, and to support large files, it requires a lot of work, but, should definitely be done at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants