<?php
$filename = $_FILES['file']['name'];
$tempname = $_FILES['file']['tmp_name'];
if(isset($filename)){
//echo $filename;
$directory = 'E:/php_uploads/';
move_uploaded_file($tempname,$directory.$filename);
echo 'Done';
}
else{
echo 'No file selected';
}
?>
<form method="POST" action= "fileupload.php" enctype = "multipart/form-data">
<input type="file" name="file"><br/><br/>
<input type="submit" value="Submit">
</form>
The enctype is correct.The element names correspond to those in the php code.So what is wrong which leads to it showing Notice: Undefined index : file in blah blah blah...?