In PHP, what is the significance of the "tmp_name" field in the $_FILES array when handling file uploads?

When handling file uploads in PHP, the "tmp_name" field in the $_FILES array stores the temporary filename of the uploaded file on the server. It is important to move this temporary file to a permanent location on the server to store the uploaded file correctly. Failing to move the file from the temporary location can result in the file being lost when the script finishes execution.

<?php
$uploadDir = 'uploads/';
$uploadedFile = $uploadDir . basename($_FILES['file']['name']);

if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadedFile)) {
    echo "File is valid, and was successfully uploaded.";
} else {
    echo "Possible file upload attack!";
}
?>