if (isset($_FILES['document']) &&
($_FILES['document']['error'] == UPLOAD_ERR_OK)) {
$newPath = '/tmp/' . basename($_FILES['document']['name']);
if (move_uploaded_file($_FILES['document']['tmp_name'], $newPath)) {
print "File saved in $newPath";
} else {
print "Couldn't move file to $newPath";
}
} else {
print "No valid file uploaded.";
}
}
?>