<form enctype="multipart/form-data" name="frmUpload" method="post" action="">
Select a file that you want to upload:<br />
<input type="file" name="users"><br /><br />
<input type="submit" name="submit" value="Upload File">
</form>
</body>
</html>
<html>
<head>
<title>File Uploader</title>
</head>
<body>
<?PHP
if(@$_POST['submit'] == "Upload File") {
if ($_FILES["users"]["error"] > 0) {
echo "<strong>Sorry, the file could not upload.</strong><br />";
echo "Error message: " . $_FILES["users"]["error"];
} else {
echo "File to upload: " . $_FILES["users"]["name"] . "<br />";
echo "File type: " . $_FILES["users"]["type"] . "<br />";
echo "File size: " . ( $_FILES["users"]["size"] / 1024) . " Kb<br />";
echo "Temp file name: " . $_FILES["users"]["tmp_name"] . "<br /><br />";
if (file_exists($_FILES["users"]["name"])) {
echo "<strong>" . $_FILES["users"]["name"] . " already exists.</strong>";
} else {
if(@move_uploaded_file($_FILES["users"]["tmp_name"], $_FILES["users"]["name"])) {
echo "<strong>Saved as: " . $_FILES["users"]["name"] . "</strong>";
} else {
echo "<strong>File: " . $_FILES["users"]["name"] . " was not uploaded!</strong>";
}
}
}
echo "<br /><br />";
}
?>
that's the code I would like to save at a certain path. But I appear to be getting errors I am relatively new to coding so please don't go in on me if you see lots of mistakes many thanks. Also, I am a student learning PHP so, please help me it would be much appreciated please educate me