Scott
Scott

Reputation: 977

Save thumbnail image directly to S3 in Rails

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

Answers (1)

Justin Wood
Justin Wood

Reputation: 80

Install the AWS S3 gem

sudo gem i aws-s3

and configure it by following the instructions here.

http://amazon.rubyforge.org/

then

S3Object.store('image.jpg', open('fileName.jpg'), 'bucketName')

Upvotes: 3

Related Questions