Reputation: 1202
I have I file upload form that looks like this
<form action="" name="edit" method="POST" class="form-horizontal" enctype="multipart/form-data">
<input type="file" name="zipfile">
<input type="submit" class="btn btn-default" value="Save">
</form>
This basically POSTs to it self. But at the top of the same file I output the $_FILES
array with print_r($_FILES);
, but it is empty after I submit the form with a 100 kb file.
I have checked my error.log file in /var/log/apache2, but there is nothing there.
My php.ini file is set to
file_uploads = On
upload_tmp_dir = /var/www/tmpdir/
upload_max_filesize = 1024M
But the tmpdir directory remains empty. This directory is set with 775 permissions and even 777 for a test, but same results. I have also, after changing the file, restarted the Apache2 service.
I must be missing something very obvious here?
Upvotes: 0
Views: 403
Reputation: 6663
You need enctype="multipart/form-data"
in the form tag
<form action="" name="edit" method="POST" class="form-horizontal" enctype="multipart/form-data">
<input type="file" name="zipfile">
<input type="submit" class="btn btn-default" value="Save">
</form>
Upvotes: 2