$path- path to the file, on the local machine.
$DOCUMENT_ROOT- PHP environment variable, containing the root path to website documents on the server machine, and
$TmpName- path to the file you checking relative to website root path.
$File="file1.jpg";When you are usually have to check a file for existence:
print "<b> Oops! The file named
$File already exists</b>";
print "<b> File named
$File does not exist </b>";