Paperclip的扩展名与其内容不匹配

时间:2017-02-21 18:42:30

标签: ruby-on-rails ruby amazon-s3 paperclip

在localhost映像上传成功但在服务器上却出错

has an extension that does not match its content

use.rb

has_attached_file :profile_picture, {
styles: {
  original: "1400>",
  medium: "400>",
  thumb: "150>"
},
path: "/users/profile_pictures/:hash.:style.:extension",
hash_secret: "um cavalo morto é um animal sem vida, um cavalo morto é um animal sem vida!",
storage: :s3,
s3_credentials: S3_CREDENTIALS,

}

validates_attachment_content_type :profile_picture, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]

我无法理解问题是什么

0 个答案:

没有答案