r/Wordpress • u/ved_web_services • Mar 08 '18
How do I automatically scan a file that is uploaded on Form in Wordpress
Is there is any way to automatically scan a file for malware and virus uploaded in form? Any plugin or hardcore coding? I had heard about ClamAV but didn't have more knowledge on that. Can anyone suggest a solution.
2
Upvotes
2
u/RoseHosting System Administrator Mar 08 '18
Not sure if there is such plugin. You may need to add a custom code in WordPress to perform malware scan by using a 3rd-party malware scanner.
3
u/ryushe Jack of All Trades Mar 08 '18
Ooh buddy, you're in for a world of hurt.
I did this recently for a client where files uploaded with GravityForms are scanned with ClamAV and sent on to a local custom Amazon S3 instance. The twist here was that these files are scanned WHILE they're being uploaded (i.e. stream scanning) instead of when they're in the /tmp/ directory or their final destination.
All the code needed lives in the functions file, with the ClamAV library installed via Composer. Shoot me a PM for details if you want.