Why is it better to use $_FILES['File'] instead of $File in PHP scripts?

Using $_FILES['File'] is better than $File in PHP scripts because $_FILES is a superglobal array that contains information about uploaded files, including file name, file type, file size, and temporary location. Accessing the file information through $_FILES['File'] ensures that you are properly handling file uploads and can perform necessary validations or processing. Using $File directly may lead to security vulnerabilities or errors in handling file uploads.

// Using $_FILES['File'] to handle file uploads
if(isset($_FILES['File'])) {
    $file_name = $_FILES['File']['name'];
    $file_type = $_FILES['File']['type'];
    $file_size = $_FILES['File']['size'];
    $file_tmp = $_FILES['File']['tmp_name'];
    
    // Process the uploaded file here
}