0

On localhost images upload successfully but on server it gives an error

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"]

I can't understand what the issue is

Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133
  • 1
    Possible duplicate of [Validation failed: Upload file has an extension that does not match its contents](http://stackoverflow.com/questions/23629888/validation-failed-upload-file-has-an-extension-that-does-not-match-its-contents) – Alex Kojin Feb 21 '17 at 18:46
  • You can rename a image.jpg, image.png, but that doesn't makes it a png, is just a jpg with a png extension. – Leonel Galán Feb 21 '17 at 19:19

0 Answers0