Send path file

This commit is contained in:
Xavier J 2016-04-14 17:43:27 +02:00
parent d01b3356c6
commit 8c4810ced3
2 changed files with 3 additions and 6 deletions

View file

@ -1,12 +1,9 @@
class ClamavService
def self.safe_io_data? io_data
def self.safe_io_data? path_file
client = ClamAV::Client.new
io = StringIO.new(io_data)
response = client.execute(ClamAV::Commands::InstreamCommand.new(io))
response = client.execute(ClamAV::Commands::ScanCommand.new(path_file))
puts response
end
end

View file

@ -5,7 +5,7 @@ class PiecesJustificativesService
dossier.types_de_piece_justificative.each do |type_de_pieces_justificatives|
unless params["piece_justificative_#{type_de_pieces_justificatives.id}"].nil?
unless ClamavService.safe_io_data? params["piece_justificative_#{type_de_pieces_justificatives.id}"].content
unless ClamavService.safe_io_data? params["piece_justificative_#{type_de_pieces_justificatives.id}"].path
end