What are some potential pitfalls of using PHP4 for file uploads in a web development project?

One potential pitfall of using PHP4 for file uploads is the lack of built-in security features, making your application vulnerable to attacks such as file injection and execution. To mitigate this risk, it is recommended to use PHP5 or later versions which have improved security features for handling file uploads.

// Example code snippet for handling file uploads in PHP5 or later versions
if ($_FILES['file']['error'] === UPLOAD_ERR_OK) {
    $uploadDir = 'uploads/';
    $uploadFile = $uploadDir . basename($_FILES['file']['name']);
    
    if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile)) {
        echo "File is valid, and was successfully uploaded.";
    } else {
        echo "Upload failed.";
    }
} else {
    echo "Error uploading file.";
}