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?
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)