php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54951 Temporary Files Are NOT Deleted
Submitted: 2011-05-29 18:08 UTC Modified: 2015-03-30 21:26 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: miqrogroove at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.6 OS: Windows 2003
Private report: No CVE-ID: None
 [2011-05-29 18:08 UTC] miqrogroove at gmail dot com
Description:
------------
In http://www.php.net/manual/en/features.file-upload.post-method.php

"The file will be deleted from the temporary directory at the end of the request 
if it has not been moved away or renamed."

This is blatantly wrong.  PHP does not automatically remove any uploaded .tmp file 
from the temporary directory.

PHP 5.3.1 and 5.3.6 were tested specifically to confirm this behavior is not as 
documented.

Test script:
---------------
test.php, placed on website:
<form method="post" enctype="multipart/form-data">
 <input name="myfile" type="file" />
 <input type="submit" />
</form>

Expected result:
----------------
While monitoring the temporary directory, essentially nothing should happen.

Actual result:
--------------
Each click of the Submit button causes an additional file to be added to the 
temporary directory.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-30 05:18 UTC] rasmus@php.net
Then that is a Windows-specific issue. They are removed everywhere else.
 [2015-03-30 21:26 UTC] cmb@php.net
-Status: Open +Status: Not a bug
 [2015-03-30 21:26 UTC] cmb@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Even on Windows uploaded files are supposed to be removed at the of
the request. I just verified with PHP 5.4.19 on Windows 7.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 16:01:26 2024 UTC