2

There is a upload feature on the site. I want to check if the file is infected before it gets processed. Is there any way to achieve this using a gem or having some inhouse code for it?

krishna sai
  • 185
  • 8

1 Answers1

3

You can try Clamby: https://github.com/kobaltz/clamby

After setup you can use the Clamby.safe?(path) command to check files.

(I also use it to check uploaded files)

  • Hey, thanks, this gem is definitely useful and would solve the problem. However I tried to make it work, but installing clamby, and trying to scan a file throws me this error `Exceptions::ClamscanMissing: clamscan application not found. Check your installation and path.` I thought if this was because of the dependency and tried to find the error in it. but it throws this error `ClamScan::RequestError: An error occured while making system call to /usr/bin/clamdscan: No such file or directory - /usr/bin/clamdscan`. If you have any clue as to why this is happening, it would be really great. – krishna sai Oct 16 '18 at 09:13
  • You need to install clamav on the server to make it work. (e.g. `sudo apt-get install clamav clamav-daemon` if you are using Ubuntu or `brew install clamav` if using macOS ) – David Szell Oct 16 '18 at 09:41