Haven't checked it, but something similar to this:
<?PHP
var $UploadTargetLocation = "C:\\My Location\\"; // best to use an absolute location, including the last slash
// var $UploadTargetLocation = realpath("my relative path"); // uncomment and use this for relative paths, though its buggy for some virtual hosts.
if(strtolower($_REQUEST("action")) == "upload"){
if($_FILES["file1"]["name"] != "" && $_FILES["file1"]["name"] != NULL){
$oFile = $_FILES["file1"];
copy($oFile["tmp_name"], $UploadTargetLocation . $oFile["name"])) or die("Failed to copy the file");
header("Location: " . $_SERVER("PHP_SELF") . "?action=success");
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form enctype="multipart/form-data" action="<?PHP echo $_SERVER['PHP_SELF']?>" method="post">
<input type="file" name="file1"/><input type="submit" name="action" value="Upload"/>
</form>
</body>
</html>