0

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?

Artem Ushakov
  • 313
  • 2
  • 12
user3784251
  • 520
  • 2
  • 10
  • 24

2 Answers2

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.

Artem Ushakov
  • 313
  • 2
  • 12
0

"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?

Community
  • 1
  • 1
sdfgee
  • 81
  • 3
  • May i know how to install and use clamav in windows?? – user3784251 Apr 05 '15 at 11:52
  • You see, this should have been mentioned in the description :) Then either use the virustotal API or check this out: http://stackoverflow.com/questions/4130203/scan-uploaded-files-for-malwares-under-windows-using-php – sdfgee Apr 05 '15 at 11:57