First, I know that there are many questions that look like this in SO. Last week I read the most, if not all of them. But I still canβt do this job for me.
I am developing a Ruby on Rails application that allows users to upload MP3 files to Amazon S3. The download itself works fine, but a progress bar will greatly improve the user's experience on the website.
I use the aws-sdk gem, which is official from Amazon. I looked everywhere in my documentation for callbacks during the boot process, but I could not find anything.
Files are downloaded one at a time directly to S3, so it does not need to be loaded into memory. No need to upload multiple files.
I decided that I might need to use jQuery to do this work, and I'm fine with that. I found this very promising: https://github.com/blueimp/jQuery-File-Upload And I even tried to follow the example here: https://github.com/ncri/s3_uploader_example
But I just couldn't get this to work for me.
The documentation for aws-sdk also BRIEFLY describes streaming downloads with a block:
obj.write do |buffer, bytes|
But this is hardly useful. How to write to the buffer? I tried a few intuitive options that would always lead to timeouts. And how would I even upgrade my browser based buffering?
Is there a better or simpler solution for this?
Thanks in advance. I would appreciate any help on this.
source share