<form enctype="multipart/form-data" method="post" action="upload2.php">
Send this file: <input name="userfile" type="file" /><br />
<input type="submit" value="Send File" />
</form>
<?php
if (move_uploaded_file($_FILES['userfile']['tmp_name'], "C:\wamp64\www\project")) {
print "Received {$_FILES['userfile']['name']} - its size is {$_FILES['userfile']['size']}";
} else {
print "Upload failed!";
}
?>
I am having trouble with uploading a file in PHP.I have been trying to make a form for uploading files.Each time I get the below error.
error: "Undefined index: userfile in C:\wamp64\www\project\firstfile.php " .Any solutions ?