PHP 4.0 Bug #7475: Temporary file leak when zero-byte files are uploaded

From: Date: Thu, 26 Oct 2000 04:30:20 +0000
Subject: PHP 4.0 Bug #7475: Temporary file leak when zero-byte files are uploaded
Groups: php.dev 
Request: Send a blank email to php-dev+get-36044@lists.php.net to get a copy of this message
From: jr-php@quo.to Operating system: Linux PHP version: 4.0.3pl1 PHP Bug Type: Unknown/Other Function Bug description: Temporary file leak when zero-byte files are uploaded If "FILE1" is a posted file and it is zero bytes in length, the following code will die with a "Failed - none" message: $tmpfile = $HTTP_POST_FILES["FILE1"]["tmp_name"]; if (!is_uploaded_file($tmpfile)) { die ("Failed - " . $tmpfile); } Not only does it fail, it leaves a zero-byte "php" temporary file behind in /tmp. But if the file is non-zero in length, it does not fail, and the temporary file is automatically deleted at exit. I can reproduce this with IE 4.01sp1, IE 5.5, and Netscape 4.75. My HTML which calls the upload script looks like this: <form method="POST" action="/doupload.php" ENCTYPE="multipart/form-data"> <input type=file name="FILE1" size=60> <input type=submit value="Upload File"> </form> -- Edit Bug report at: http://bugs.php.net/?id=7475&edit=1

« previous php.dev (#36044) next »