Answer the question
In order to leave comments, you need to log in
How to block-by-block upload a large file to S3 in Ruby, having previously encoded it in Base64?
You need to upload a large media file (more than available RAM) to S3 storage, having previously encoded it in Base64.
Help optimize your Ruby code so that reading a file, Base64 encoding, and then uploading to S3 is done block by block.
blob = StringIO.new( Base64.encode64( IO.binread('big_file.mp4')), 'rb' )
...
@client.put_object(
bucket: @s3_bucket.name,
key: target_name,
body: blob,
acl: 'public-read'
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question