Are there any security concerns to be aware of when implementing a file upload status feature in PHP?

One security concern when implementing a file upload status feature in PHP is the risk of exposing sensitive information about the server's file system to potential attackers. To mitigate this risk, ensure that the file paths displayed in the status feature do not reveal any confidential information and sanitize user input to prevent directory traversal attacks.

// Sanitize user input to prevent directory traversal attacks
$fileName = basename($_FILES["file"]["name"]);
$filePath = "uploads/" . $fileName;

// Display file upload status without revealing sensitive information
echo "File uploaded successfully: " . $fileName;