2
votes

I'm using Paperclip to handle image uploads for my Rails app, and it's working great when I use system storage: multiple thumbnail sizes ("styles" in Paperclip parlance) are saved to file, and I can access any of them by passing the style name to the url method.

When I set up the app to store images on S3 (using the aws-s3 gem), however, only one image is stored in my S3 bucket. For what it's worth, only the last style listed is stored. So, if in my model, I've got:

  has_attached_file :photo,
                :styles         => { :large  => "1000x1000>", 
                                     :medium => "600x600>", 
                                     :thumb  => "200x200>" },
                :storage        => :s3,
                :s3_credentials => "#{Rails.root}/config/s3.yml",
                :bucket         => AppConstants.bucket,
                :path           => "pictures/:id/:filename"

Only the "thumb" size will be saved to S3.

Has anybody encountered a similar problem? How can I fix this?

1

1 Answers

10
votes

I'm not sure why this works locally, but you didn't specify :style in your path declaration.