$currentdir=getcwd();
$target_path = $currentdir . "/" . basename($_FILES['file']['name']);
echo "Target: $target_path
";
$temploc=$_FILES['file']['tmp_name'];
echo "Temploc: $temploc
";
if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['file']['name']). " has been uploaded
";
} else {
echo "There was an error uploading the file, please try again!
";
}