I use Paperclip 2.3.5 in a Rails application to store PDFs on Amazon S3. For each PDF, a JPG thumbnail is created by ImageMagick. Im 'using this configuration in the model:
has_attached_file :file,
:styles => { :thumb => { :geometry => "200x200>",
:format => :jpg
} },
:whiny => false,
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:s3_permissions => 'authenticated-read',
:s3_headers => { 'Expires' => 1.year.from_now.httpdate },
:url => "s3.amazonaws.com",
:path => "documents/:id/:style/:basename.:extension",
:bucket => 'mybucket'
But there is a problem: the generated sketch is uploaded to S3 using the content_type "application / pdf", which is WRONG because it is a JPG (you can see the content_type of the file on S3 using the S3 search tool such as Cyberduck). For the original PDF, this content_type is correct, but not for the thumbnail. This causes problems in some browsers (e.g. Chrome or Safari) that do not display the inline thumbnail.
: Content_type, ( "file_content_type" ), "application/pdf", - , content_type .
content_type , ?