Forum Moderators: coopster
i have it creating the directory but it will not check to see if the dir exists
say if i had a directory /home/cheese/
how would i script it to check is cheese exisited.
thanks guys
$todir$entry is the file path to the file i want to check
$checkfile = "$todir$entry";
if (!is_file($checkfile))
{
<copy file over>
}
else
{
<file exists go away>
}
This is not successful it allows the transfer to go thru every time :(
if (!file_exists($path.$_FILES['file']['name'))
move_uploaded_file($_FILES['file']['tmp_name'], $path.$_FILES['file']['name']);
Where $path is the path to your directory. This checks if an uploaded file isn't already in a directory defined by $path. If so, it copies the uploaded file there. Otherwise, it doesn't do anything, leaving the file already there intact.
Is that what you wanted? Or is it not uploaded files you're working with?