Rails / Heroku - How to anti-virus scan uploaded f

2019-05-06 22:53发布

问题:

How is it possible to scan a uploaded file for viruses, trojans etc.?

Just thinking about preventing some users to upload some nasty stuff.

I am using Heroku and Amazon S3.

回答1:

check out This

it's support a REST/JSON antivirus web service

Here is the post - https://stackoverflow.com/questions/4104985/antivirus-scanning-service



回答2:

For the passers-by asking the same question:

Metascan. It's free and has a simple API!



回答3:

For anyone approaching this in future we recently created CarrierWave::AttachmentScanner to easily integrate virus and malware scanning into Rails and CarrierWave.

The plugin basically hooks into file uploads using carrierwave and sends the request to a JSON/REST web service to check the files.

If the file matches a known signature then it will raise a CarrierWave:: IntegrityError.