ruby - Download file from S3 to Rails 4 app -


i have aws vm runs daily task , generates several files. want rails app download these files , place them in folder within app. there gem or method in ruby can this?

i know how in bash s3cmd , guess create script them way, looking more native rails way.

i using data in these files app, don't want users able download them.

the aws-sdk v2 gem provides simple interface downloading objects amazon s3.

require 'aws-sdk'  s3 = aws::s3::resource.new(   region: 'us-east-1',   access_key_id: '...',   secret_access_key: '...' )  s3.bucket('bucket-name').object('key').get(response_target: '/path/to/file') 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -