fileupload.html
<html>
<body>
<form name="frmname"action="upload.php" method="post">
upload your file:<input type="file" name="file"><br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
upload.php
<?php
if ($FILES["file"]["error"] > 0)
{
echo "Error:". $FILES["file"]["error"] ."<br>";
}
else
{
echo "upload:". $FILES["file"]["name"] ."<br>";
echo "type:". $FILES["file"]["type"] ."<br>";
echo "size:". ($FILES["file"]["size"]/1024) ."kb<br>";
echo "stored in:". $FILES["file"]["tmp_name"] ."<br>";
}
?>
when i uploading some text file and click submit button the following o/p is showing:
Notice: Undefined index: file in c:\easyphp1-8\www\upload.php on line 2
Notice: Undefined index: file in c:\easyphp1-8\www\upload.php on line 8
upload:
Notice: Undefined index: file in c:\easyphp1-8\www\upload.php on line 9
type:
Notice: Undefined index: file in c:\easyphp1-8\www\upload.php on line 10
size:0kb
Notice: Undefined index: file in c:\easyphp1-8\www\upload.php on line 11
stored in:
how to reslove this problem..thanks in advance..