anonymousdude Posted March 23, 2010 Share Posted March 23, 2010 Hi Everyone, I'm trying to create a script that allows users to upload photos. Obviously anytime you allow a user to upload a file security is a concern. I was pretty surprised that the PHP Security book I'm reading didn't mention much about scanning uploads for Viruses. Rather it mainly just spoke about using is_uploaded_file and move_uploaded_file. I'm wondering how I can implement a virus scan on the file before using move_uploaded_file to save the file on a directory on the server. It seems allowing random users to upload files to your server without performing a virus scan would be a pretty foolish thing to do. Does anyone have any info on how I could do this? Thanks! Link to comment https://forums.phpfreaks.com/topic/196304-scanning-uploads-for-viruses-before-saving-to-server/ Share on other sites More sharing options...
o3d Posted March 23, 2010 Share Posted March 23, 2010 When the file is in the /tmp/ folder, before you call move_uploaded_file you could read the following article http://linuxhelp.blogspot.com/2005/10/clamav-free-anti-virus-solution-for.html and implement a shell command to scan the $_FILES['file']['tmp_name'] Link to comment https://forums.phpfreaks.com/topic/196304-scanning-uploads-for-viruses-before-saving-to-server/#findComment-1030825 Share on other sites More sharing options...
anonymousdude Posted March 23, 2010 Author Share Posted March 23, 2010 When the file is in the /tmp/ folder, before you call move_uploaded_file you could read the following article http://linuxhelp.blogspot.com/2005/10/clamav-free-anti-virus-solution-for.html and implement a shell command to scan the $_FILES['file']['tmp_name'] Thanks for the reply. There isn't by any chance a similar Windows solution that you know of? Link to comment https://forums.phpfreaks.com/topic/196304-scanning-uploads-for-viruses-before-saving-to-server/#findComment-1030829 Share on other sites More sharing options...
teamatomic Posted March 23, 2010 Share Posted March 23, 2010 http://sourceforge.net/projects/php-clamav/ mod_clamav for apache2 has a CLI HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/196304-scanning-uploads-for-viruses-before-saving-to-server/#findComment-1030836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.