PHP: When does the temporary uploaded files get deleted?
As soon as your PHP script finishes executing and re-saving to the defined location
Example using straight PHP, no framework
http://www.php.net/manual/en/features.file-upload.post-method.php
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
If you do not do anything with them they will be deleted right after the script is finished.