# Upload
$file=$_FILES["uploadedfile"]["name"];
if (file_exists($root.$file)) { if(!unlink($root.$file)) { c4error2("Unable to current file of that name - Please try again."); } }
if (file_exists($root.$file)) { c4error2("That file by the name of <b>$file</b> exists<BR>please rename it and try again"); }
$nroot = $root.basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $nroot)) { }
else { c4error2("There was an error uploading the file, please try again!"); }
rename($root.$file, $root.$code.$file);
When I use this script for images it works 100%, when I use it for a .doc - I get the final error check (There was an error uploading the file, please try again!), do I know do to something different for files other than images?
Thanks