Custom Laravel 5 anti-virus validator for file uploads.
You must have ClamAV anti-virus scanner running on the server to make this package work.
You can see the ClamAV installation instructions on the official ClamAV documentation.
For example on an Ubuntu machine, you can do:
# Install clamav virus scanner
sudo apt-get update
sudo apt-get install clamav-daemon
# Update virus definitions
sudo freshclam
# Start the scanner service
sudo service clamav-daemon start
This package is not tested on windows, but if you have ClamAV running (usually on port 3310) it should work.
Install the package through Composer.
Run composer require sunspikes/clamav-validator
Add the following to your providers
array in config/app.php
:
'providers' => array(
// ...
Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class,
),
Use it like any Validator
rule:
$rules = array(
'my_file_field' => 'clamav',
);
2014.12.05 - Initial version, using extension php-clamav
2014.12.05 - Removed the dependency php-clamav, Now using Quahog
2015.10.20 - Updated for Laravel 5
2015.11.20 - Updated to use PSR-4
2015.12.03 - Added limited windows support
Krishnaprasad MG [@sunspikes]
Contact me at [sunspikes at gmail dot com]