views:

32

answers:

1

I have an application which has the requirement, but infrequent usage, of uploading an image for use in other parts of the application. It's not something that is done frequently, nor is it frequently viewed (such as a photo). It is an image which is then sent through an API to print and deliver as a postcard.

Initially I used paperclip and loved how easy it was to attach the image to the Model. But on heroku I would need to then set it up to work with S3, which could be fine, but I've been thinking that perhaps it should just be in the database.

I need to upload it as a binary through the API each time I sent it as a postcard.

What would be the recommended way to do this? Is there a plugin or gem that would make it easier? Is uploading to the database as a blog a more straightforward way?

+1  A: 

paperclip is pretty easy to setup and a buddy of mine has a site that he just did with a fair number of images uploaded from it, and his total S3 bill from amazon last month was 10 cents. SO I wouldn't shy away from it because of cost. I just added the paperclip folder from one of my apps to S3 to scope what it would cost. I can report back in a week or so when I get my first bill.

Jed Schneider
Agree with Jed here; if you store the images in the database, you'll end up needing to pay for database storage on heroku. (and at a higher rate than S3).
Jesse Wolgamott