I have a simple HTML form containing a file input. When the form is submitted without a file, printing the $_POST
array shows me all of the data submitted. When a file is submitted, however, $_POST
doesn't print out any of the submitted data.
Can somebody tell me why? This is my code:
<?php
print_r($_POST);
?>
<form action="test.php" method="post" enctype="multipart/form-data">
<label for="myfile">Video File:</label>
<input type="file" name="myfile" />
<br /><br />
<label for="mytitle">Title:</label><br />
<input type="text" name="mytitle" size="55" maxlength="60" />
<br /><br />
<input type="submit" name="mysubmit" value="Submit Video for Approval" />
</form>
You have to use $_FILES to access the uploaded files.
Your script seems fine. Please check your server configuration. Perhaps you exceed POST limits (set with post_max_size in php.ini)