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

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.

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

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?

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

Walter