ruby on rails - Paperclip Gem - "Image has contents that are not what they are reported to be" Error -


the website's function post blog post. it's running locally on windows 7. i've tried on paperclip gem (both versions 4.2.4 , 4.3) , server goes infinite loop in cmd (doesn't happen on 4.2.4 still error). did bundle install , it's installed.

gemfile:

gem "paperclip", "~> 4.3" 

here's model:

class post < activerecord::base      has_attached_file :image, :default_url => ":style/rails1.jpg"     validates_attachment_content_type :image, :content_type => /\aimage\/.*\z/  end 

this error when trying submit image (png or jpg):

image has contents not reported be

i'm new detailed explanations appreciated. read other fixes on here nothing worked.

figured out temporary solution:

add file

config/initializers/paperclip_media_type_spoof_detector_override.rb

require 'paperclip/media_type_spoof_detector' module paperclip   class mediatypespoofdetector     def spoofed?       false     end   end end 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -