Jump to content

[SOLVED] How to check files for virus?


ali_kiyani

Recommended Posts

Hello,

I have an application in PHP where users upload different files to server.

Q1. Is there a way I can check those files for virus when user uploads?
Q2. If a virus is found in some file, how can I display message to the user?
Q3. Let's say if I have a dedicated server with antivirus installed, what do I need to do to integrate it with PHP?
Q4. Can this be done on shared hosting environment?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/28712-solved-how-to-check-files-for-virus/
Share on other sites

[quote author=ali_kiyani link=topic=116557.msg474996#msg474996 date=1164701746]
Hello,

I have an application in PHP where users upload different files to server.

Q1. Is there a way I can check those files for virus when user uploads?
Q2. If a virus is found in some file, how can I display message to the user?
Q3. Let's say if I have a dedicated server with antivirus installed, what do I need to do to integrate it with PHP?
Q4. Can this be done on shared hosting environment?

Thanks
[/quote]

A1. Yes, after the user upload.
A2. Return a message:

[code]
echo "Go to hell !\n";
[/code]

A3: You can use the command "system()" for execute commands lines and check the files, like this:

[code]
$check = system("antivirus file");

if($check ...
[/code]

A4: Yes.

  • 3 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.