When handling uploads with PHP often it can happen, that the $_FILES array is simply empty. This can occur when one of the following things is true:
- Check php.ini for file_uploads = On, post_max_size, and upload_max_file_size. Make sure you’re editing the correct php.ini – use phpinfo() to verify your settings.
- Make sure your FORM tag has the enctype=”multipart/form-data” attribute.
- Do not use javascript to disable your form file input field on form submission!
- Make sure your directory has read+write permissions set for the tmp and upload directories.
- Make sure your FORM tag has method=”POST”. GET requests do not support multipart/form-data uploads.
- Make sure your file destination and tmp/upload directories do not have spaces in them.
- Make sure all FORMs on your page have /FORM close tags.
- Make sure your file input tag has a NAME attribute. An ID attribute is NOT sufficient! ID attributes are for use in the DOM, not for POST payloads.
- Your /tmp folder is full
Hope this helps!