Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm using CarrierWave and Fog to store attachments to an ActiveRecord model on S3. I can use them to generate the URL, but I can't seem to locate any method to actually read a file.

Is this something that the Fog gem will even do, or do I need to use the S3 gem for that?

1 Answer

0 votes
by (44.3k points)

On the uploader object, you can use the read method. You can do this following: 

obj = MyModel.first

contents = obj.attachment.read

This will get the actual contents of the file. 

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories

...