|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-01 13:19 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 00:00:02 2025 UTC |
Description: ------------ I am writting because I am working on a script that uses CLAMAV to scan uploaded files for viruses. I have noticed that when I upload a file that is infected with test virus such a "eicar.com.txt" the file gets deleted even if I rename or move the file or get a chance to scan it for viruses. If PHP is deleting the file is there any way to stop the file from being deleted or output the reason why the file was deleted. Reproduce code: --------------- <? chmod ("$img", 0775); $tmp_file = "/tmp/". md5(uniqid(rand(), true)); rename("$img", $tmp_file); $clamscan_prog = "/usr/local/bin/clamscan"; $data_input = "-v --stdout $tmp_file"; $data_size = strlen("$data_input"); $scan_result = passthru("$clamscan_prog $data_input"); //unlink("$img"); die("$tmp_file <br> $scan_result"); ?>