1, Disable from global config file: config/application.rb
require 'paperclip/media_type_spoof_detector'
module Paperclip
class MediaTypeSpoofDetector
def spoofed?
false
end
end
end
2, Disable from controller
class Logserver < ActiveRecord::Base
has_attached_file :serverkey, :path => "public/keys/:id/:filename", :url => "/keys/:id/:basename.:extension"
#validates_attachment_content_type :serverkey, :content_type => /\Atext.*\Z/
do_not_validate_attachment_file_type :serverkey
end
Tuesday, May 13, 2014
Subscribe to:
Posts (Atom)
-
Step 1, New a project rails new demo Step 2, Update Gemfile add paperclip, mysql2 gem, enable JavaScript runtime gem 'mysql2' ...
-
Disk is out of space [root@reyotest stat]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 231825...
-
When trying to access transmission from web-browswer i got the message : 403: Forbidden Unauthorized IP Address. Either disable the IP ad...