ali_kiyani Posted November 28, 2006 Share Posted November 28, 2006 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 Link to comment Share on other sites More sharing options...
PHPSpirit Posted November 28, 2006 Share Posted November 28, 2006 [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. Quote Link to comment Share on other sites More sharing options...
ali_kiyani Posted March 23, 2007 Author Share Posted March 23, 2007 I have found a way and that is to use ClamAV anti virus. You can use some commands it exposes in PHP to detect viruses. Haven't tried it yet though. Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 23, 2007 Share Posted March 23, 2007 Hmm..You must have some nasty users if you want to get this XD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.