What are the potential pitfalls or common mistakes to avoid when trying to move uploaded files using PHP?

One common mistake when moving uploaded files using PHP is not checking if the file was successfully uploaded before attempting to move it. To avoid this pitfall, always check if the file was uploaded using the `is_uploaded_file()` function before moving it.

if (isset($_FILES['file']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
    $uploadDir = 'uploads/';
    $uploadFile = $uploadDir . basename($_FILES['file']['name']);
    
    if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile)) {
        echo "File successfully uploaded and moved.";
    } else {
        echo "Error moving file.";
    }
} else {
    echo "File not uploaded.";
}