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

Fix uploads for files larger than 2GB #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sulphur
Copy link

@sulphur sulphur commented Sep 5, 2022

Hi,
Currently Waffle ( well erlang's :file.write which Elixir's File.write uses) fails to writes files greater than 2GB and as such we can't upload files larger than 2GB. This PR uses stream to write instead.

Copy link
Member

@achempion achempion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍 Thank you for the provided fix

body
|> StringIO.open()
|> elem(1)
|> IO.binstream(1024*1024*10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this number exactly?

Copy link
Author

@sulphur sulphur Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is arbitrary. I'm using 10MB chunks to write to files. When to small it can be long when to high it will use to much memory i figured 10Mb is good compromise today. I don't know what would be best here :)

@darwin67
Copy link

@achempion Is this PR expected to be merged soon?

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

Successfully merging this pull request may close these issues.

3 participants