What potential security risks are present in the PHP code provided for the FTP uploader?

The potential security risk in the provided PHP code is that it is vulnerable to directory traversal attacks. An attacker could manipulate the `$file` variable to upload files to unintended directories or overwrite existing files. To mitigate this risk, we should sanitize the `$file` variable to ensure it only contains the filename without any directory paths.

$file = basename($_FILES["fileToUpload"]["name"]);
$target_dir = "uploads/";
$target_file = $target_dir . $file;