demarches-normaliennes/app/services/clamav_service.rb
2016-04-15 15:32:15 +02:00

12 lines
No EOL
283 B
Ruby

class ClamavService
def self.safe_file? path_file
FileUtils.chmod 0666, path_file
client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(path_file))
return false if response.first.class == ClamAV::VirusResponse
true
end
end