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

From: Date: Mon, 30 Oct 2000 15:34:03 +0000
Subject: PHP 4.0 Bug #7475 Updated: Temporary file leak when zero-byte files are uploaded
Groups: php.dev 
Request: Send a blank email to php-dev+get-36409@lists.php.net to get a copy of this message
ID: 7475 Updated by: stas Reported By: jr-php@quo.to Status: Closed Bug Type: Unknown/Other Function Assigned To: Comments: Should be fixed in CVS. Please reopen if stil happens. Previous Comments: --------------------------------------------------------------------------- [2000-10-26 00:30:20] jr-php@quo.to 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> --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7475

« previous php.dev (#36409) next »