Which version of Paperclip do you use? There was a security issue with file
types hence they changed the behaviour in version 4.0 of paperclip, but of
course there was an error in 4.0 concerning content type mapping. In 4.1
they introduced a possibility to add options like so:
Paperclip.options[:content_type_mappings] = {
:pem => "text/plain"
}
or not writing it with the rocket hash notation but with symbols you want
to write
Paperclip.options[:content_type_mappings] = {
php: 'text/x-php'
}
I found the quoted solution there =>
https://github.com/thoughtbot/paperclip/issues/1462
On Friday, August 22, 2014 5:18:44 PM UTC+2, Ruby-Forum.com User wrote:
>
> Hello,
>
> I am learning rails and trying to use ckeditor and paperclip.
> When I try and upload an image file, I get:
>
> [paperclip] Content Type Spoof: Filename 1.jpg (["image/jpeg"]), content
> type discovered from file command: . See documentation to allow this
> combination.
> (1.0ms) ROLLBACK
>
> What do I need to change to resolve this?
>
> my picture.rb contains:
> validates_attachment_content_type :data, :content_type => /\Aimage/
>
> Thank you
>
> Frank
>
> --
> Posted via http://www.ruby-forum.com/.
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/cb7a3909-e396-4a5b-91ca-391e3754bb9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.