scan uploaded file for virus in user's machine

2019-08-16 10:51发布

问题:

Is there any way to scan the file uploaded by user in their machine using PHP?

I am creating a website using PHP, where I give users the privilege to upload files of any format. Now I want to scan the files uploaded by the users for any virus or malware. Also I want to scan it before placing it in the server.

Is there any Online sites available to scan those files? Or give me any other best way to achieve this.

I am using Xampp (phpmyadmin) in Windows.

Any Suggestion?

回答1:

There is a useful resource you can use for free: virustototal.com They have API to include in your PHP scripts as well.

The other option is to use ClamAV, but I'm not perfectly sure about this.



回答2:

"ClamAV is a free anti virus commonly used on server applications.

php-clamav is an extension for binding ClamAV to PHP. You can check their documentation." from What are my options to check for viruses on a PHP upload?