I use this code to read information from a flash file that uploads files to my server.
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['Filedata']['name']);
if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $target_path))
{
echo "The file ". basename( $_FILES['Filedata']['name']). " has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
What would I have to do to have it check to see if a file already on the server exists so it doesn't get overwritten?