Jump to content

Scanning Uploads For Viruses Before Saving To Server?


anonymousdude

Recommended Posts

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!

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']

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?

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.