well, after looking at the PHP manual a bit, I get this outputted to the browser:
Warning: move_uploaded_file(I:/SERVER~1/Xitami/webpages/uploads/gnumans IP.txt) [function.move-uploaded-file]: failed to create stream: No such file or directory in I:\SERVER~1\Xitami\webpages\ftest\file.php on line 61
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'I:\Server Files\php\uploadtemp\php275.tmp' to 'I:/SERVER~1/Xitami/webpages/uploads/gnumans IP.txt' in I:\SERVER~1\Xitami\webpages\ftest\file.php on line 61
Sorry, but there was no valid upload file, or there was an error.
with this code in the last part:
} elseif(isset($_GET['writefile'])){
// if(isset($_FILES['upload'])){
$name = $_FILES['upload']['name'];
$uploadfile = $_FILES['upload']['tmp_name'];
$uploaddir = "$root/uploads/".$_FILES['upload']['name'];
if(move_uploaded_file($uploadfile, $uploaddir)){
echo "File uploaded and moved!";
} else {
echo "Sorry, but there was no valid upload file, or there was an error.";
}
// }
}
and the form tag looks like this:
<form action="file.php?writefile" method="post" enctype="multipart/form-data">