Paperclip + S3 + Background Worker

103 views
Skip to first unread message

Justin S

unread,
Feb 3, 2012, 8:50:23 PM2/3/12
to WellRailed
Does anyone have tips around Paperclip + Amazon S3 + Background Worker
in the context of image uploads? Any patterns around image uploading?

Kem Mason

unread,
Feb 3, 2012, 10:21:01 PM2/3/12
to wellr...@googlegroups.com
I'm not sure about Paperclip, but I there's an amazon gem http://amazon.rubyforge.org/ that is very handy for use with S3 -- can upload files by just doing:

require 'aws/s3'
AWS::S3::Base.establish_connection!(:access_key_id     => 'your-access-key',:secret_access_key => 'your-secret-access-key'  ) 
AWS::S3::S3Object.store('Image name', open('image-filename.jpg'), 'your-bucket-name')

then you can get a url for an image with:

AWS::S3::S3Object.url_for('Image name', 'your-bucket-name', :use_ssl => true, :expires_in => 20)


On Sat, Feb 4, 2012 at 2:50 PM, Justin S <justi...@gmail.com> wrote:
Does anyone have tips around Paperclip + Amazon S3 + Background Worker
in the context of image uploads? Any patterns around image uploading?

--
You received this message because you are subscribed to the Google Groups "WellRailed" group.
To post to this group, send email to wellr...@googlegroups.com.
To unsubscribe from this group, send email to wellrailed+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wellrailed?hl=en.


Warren Seen

unread,
Feb 7, 2012, 11:10:54 PM2/7/12
to wellr...@googlegroups.com
Do you HAVE to use paperclip? Maybe take a look at carrierwave if not.

Having said that, have a look at delayed_paperclip and the paperclip-s3 gems (paperclip does have S3 support baked in, but I understand this gem makes it easier if you're on heroku..).

Justin S

unread,
Feb 8, 2012, 4:05:38 PM2/8/12
to WellRailed
Thanks guys!

On Feb 8, 5:10 pm, Warren Seen <warren.s...@gmail.com> wrote:
> Do you HAVE to use paperclip? Maybe take a look at carrierwave if not.
>
> Having said that, have a look at delayed_paperclip and the paperclip-s3 gems (paperclip does have S3 support baked in, but I understand this gem makes it easier if you're on heroku..).
>
> On 04/02/2012, at 2:21 PM, Kem Mason wrote:
>
>
>
>
>
>
>
> > I'm not sure about Paperclip, but I there's an amazon gemhttp://amazon.rubyforge.org/that is very handy for use with S3 -- can upload files by just doing:
>
> > require 'aws/s3'
> > AWS::S3::Base.establish_connection!(:access_key_id     => 'your-access-key',:secret_access_key => 'your-secret-access-key'  )
> > AWS::S3::S3Object.store('Image name', open('image-filename.jpg'), 'your-bucket-name')
>
> > then you can get a url for an image with:
>
> > AWS::S3::S3Object.url_for('Image name', 'your-bucket-name', :use_ssl => true, :expires_in => 20)
>
> > On Sat, Feb 4, 2012 at 2:50 PM, Justin S <justinso...@gmail.com> wrote:
> > Does anyone have tips around Paperclip + Amazon S3 + Background Worker
> > in the context of image uploads? Any patterns around image uploading?
>
> > --
> > You received this message because you are subscribed to the Google Groups "WellRailed" group.
> > To post to this group, send email to wellr...@googlegroups.com.
> > To unsubscribe from this group, send email to wellrailed+...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/wellrailed?hl=en.
Reply all
Reply to author
Forward
0 new messages