Re: Advice on virus checking uploaded files?
| From: | Tom Rogers | Date: | Sat, 17 May 2003 09:42:45 +0000 |
| Subject: | Re: Advice on virus checking uploaded files? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148017@lists.php.net to get a copy of this message | ||
Hi,
Saturday, May 17, 2003, 7:22:39 PM, you wrote:
DF> My PHP script needs to check uploaded files for viruses. Does anyone have
DF> any advice on how best to do this when using PHP4 under Linux 7.1? I have my
DF> own web server, so can install what I like on it, but I just do not know
DF> what (if any) virus checker to obtain/purchase, and how I would drive it
DF> from my PHP scripts. Any help very much appreciated. Thanks.
DF> Dan
Use the system command to scan the temp file before copying it to its
final resting place.
system('clamscan '.$_FILES['uploadname']['temp_name'],$ret);
if($ret){
echo 'eek a virus...';
}else{
move_uploaded_file($_FILES['uploadname']['temp_name'],$whatever);
}
--
regards,
Tom