<?php
    if (isset($_POST["submit"])) // check if a file has been submitted and if it is an image
    {
        $dir = "uploads/"; // directory where files are going
        $file = $dir . basename($_FILES["file_uploaded"]["name"]); // file's path and name uploaded
   
       if (file_exists($file)) // check if file exists
       {
           echo "File already exists";
       }
       else {
           // ... check type, size..., UPLOAD
       }
   }
?>