<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
I have this form and I would like to know, in the upload.php file if anything was submitted in the type="file".
This tells me nothing was submitted, even when I submitted a file:
<?php
if (empty($_FILES["file"]["file"]))
{
echo "No file was submitted, try again.";
}
?>
This also tells me nothing was submitted, even when I submitted a file:
<?php
if (empty($_POST["file"])
{
echo "No file was submitted, try again.";
}
?>
Thanks in advance!