Reputation: 977
I'm using an API to grab a thumbnail image. The API request automatically downloads the image. I'd like to store that image directly in my S3 bucket. It seems like overkill to use something like Carrierwave for this. How can I make the API call and save the image directly in S3?
Upvotes: 0
Views: 559
Reputation: 80
Install the AWS S3 gem
sudo gem i aws-s3
and configure it by following the instructions here.
then
S3Object.store('image.jpg', open('fileName.jpg'), 'bucketName')
Upvotes: 3