i check all topics in stack about files and undefined index error but cant find answer anywhere. I have two files:
wpis.html
<form action="wpis.php" method="POST">
<input type="file" name="file">
<input type="submit" name="Submit" value="Submit">
</form>
wpis.php
if($_POST["Submit"])
{
echo $name = $_FILES['file']['name'];
$size = $_FILES['file']['size'];
$type = $_FILES['file']['type'];
$tmp_name = $_FILES['file']['tmp_name'];
}
And every time i'm getting this error : Undefined index: file in... I tried it on my computer using intellij plugin and on local host using wamp server with uploadfiles turn on. And ideas what may be the problem?
enctype="multipart/form-data"added, your code works so this can not be reproduced.