Paperclip: validates_attachment_content_type always fails in IE 6,7 and 8 for jpeg and png image
On July 14, 2011,
in IT Related, Ruby on Rails,
by admin
This validation does not work in IE 6 and 7. Because IE treats files differently, they added extra text on them (I’ve not clear on this point why they add).
please refer this link http://groups.google.com/group/paperclip-plugin/browse_thread/thread/3e09d6943616ce7b
Solution For This problem:
you need to add following format in your validation
for jpeg image - image/pjepg and for png image image/x-png format add in your in validates_attachment_content_type
eg: validates_attachment_content_type :image, :message => ‘Please upload correct format’, :content_type => %w( image/jpeg image/png image/gif image/pjpeg image/x-png )
For ‘gif’ image no additional format require in IE.
Source: blog.joshsoftware.com
