I ran into the error that when I upload images to S3 via Paperclip, I get an error: has an extension that does not match its contents
. On a local machine, I do not experience such problems, only for production. This was observed after the update of rails 4.1.1 -> 4.1.16
and ruby 2.1.5 -> 2.3.1
and changing the instance to AWS.
Here is my validation:
validates_attachment :document,
content_type: { not: "application/x-msdownload" }
I do not understand what the problem is. Any file I upload, whether it's an image or a document (any extension) gets this error. Tell me please, with what it can be connected?
UPD
I found in log this:
[paperclip] Content Type Spoof: Filename example1.png (["image/png"]), content type discovered from file command: . See documentation to allow this combination.
UPD 2
This solved my problem