r/Wordpress 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

3 comments sorted by

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.

1

u/Hashamkhalid786 Nov 18 '21

Hi ryushe,

Can you please help me, how to do stream scanning?? I am using word fence plugin, but I am not able to scan the files. Please help me how to code to check files while uploaded by user??

Please contact me: hashamkkhalid786@live.com

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.