How can the enctype="multipart/form-data" attribute affect file uploads in PHP?

When using the enctype="multipart/form-data" attribute in a form that uploads files in PHP, it is important to set this attribute correctly to ensure that the file data is properly encoded and sent in the HTTP request. Failure to set this attribute can result in the uploaded file data not being available in the $_FILES superglobal array.

<form action="upload.php" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" value="Upload">
</form>