HTML:
<form action="formhandler.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" name="submit" value="Submit" />
</form>
and running print_r($_FILES)in formhandler.php after selecting the file and clicking submit:
[file] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
And error code 4, according to the manual, means "UPLOAD_ERR_NO_FILE - the file was not loaded", but I can not understand why it was not downloaded.
source
share