# Uploading Photos - HowTo with Rails 3 ---- Which Gem?, S3?

**URL:** <https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984>\
**Category:** Rails\
**Created:** [October 4, 2010, 8:31pm UTC](https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984 "2010-10-04T20:31:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MadMen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@MadMen](https://www.ruby-forum.com/u/MadMen)\
**Post date:** [October 4, 2010, 8:31pm UTC](https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984/1 "2010-10-04T20:31:24Z")

</div>

Hi,

Here’s what I’m trying to achieve:

1. Allow users to upload a photo for their profile
2. Allow users to upload photos as blog posts

That being said, here’s what I need your expert opinion on:

1. S3, is this still the best choice? Any better easier, Rails3 like  
alternatives? Or should I go with S3
2. What Rails 3 Gem supports this best? Allowing me to upload photos  
to S3 and assign some type of referenceID throughout the app for USERS  
& BlogPostings.

Eager to hear your suggestions.

---

<div class="post-metadata">

**Author:** ![MadMen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@MadMen](https://www.ruby-forum.com/u/MadMen)\
**Post date:** [October 4, 2010, 8:43pm UTC](https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984/2 "2010-10-04T20:43:07Z")

</div>

Paperclip makes this desperately easy, even the S3 part. It’s a simple  
configuration change and your files will be saved in S3 versus local  
storage.

Files are saved as attributes of another model record, so you don’t  
have a separate Image model, you have post\_image and user\_image, and  
Paperclip takes care of all the dependencies for you. If you wanted to  
have multiple pictures per blog post, then you might need a separate  
model for that, with belongs\_to :post and post has\_many :photos and  
Paperclip added to your Photo model as photo\_image or something like  
that.

Walter

---

<div class="post-metadata">

**Author:** ![MadMen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@MadMen](https://www.ruby-forum.com/u/MadMen)\
**Post date:** [October 4, 2010, 11:29pm UTC](https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984/3 "2010-10-04T23:29:19Z")

</div>

Thanks Walter for the recommendation. I also will need to upload other  
non-image file types to S3. Do you recommend Paperclip for that as  
well?

---

<div class="post-metadata">

**Author:** ![MadMen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@MadMen](https://www.ruby-forum.com/u/MadMen)\
**Post date:** [October 5, 2010, 1:49am UTC](https://www.ruby-forum.com/t/uploading-photos-howto-with-rails-3-which-gem-s3/195984/4 "2010-10-05T01:49:12Z")

</div>

Paperclip can upload anything you can stuff in a file upload control.  
I’ve used it for PDF, Word, zip, pretty much anything.

Walter
