What I did to solve my issue was the html form had an ID of "formid", but the input tag was attached to the form with ID of "form". I didn't think it actually mattered to PHP, but apparently it does.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
[SOLVED] Problem:$_FILES always empty after uploading
in PHP Coding Help
Posted
It's 2023 and I just had the exact same issue. Here is how I solved mine (hopefully stopping someone in the future from having a headache!)
And for the PHP:
On submitting the form, I would always get an empty $_FILES array:
{"success":true,"error":"","debug":{"$_POST":[],"$_FILES":[],"post_max_size":"20M","upload_max_filesize":"20M","file_uploads":"1"}}
What I did to solve my issue was the html form had an ID of "formid", but the input tag was attached to the form with ID of "form". I didn't think it actually mattered to PHP, but apparently it does.