I am trying to create an upload script and am having issues with IE8 and older. (of course 😉 ) In all other browsers it works fine but in IE8 the $_FILES array is empty. This is the html code being used:
<FORM method=post action=api/upload.php target=form8230839>
<INPUT name=file type=file>
<INPUT value="Submit Query" type=submit>
<INPUT name=id value=id66130748349062623150808191 type=hidden>
</FORM>
<IFRAME id=form8230839 name=form8230839></IFRAME>
(note the code is being generated by javascript createElement so IE8 is writing it out with the caps and lack of quotes around attributes.)
Then in the php file I am doing:
print_r($_FILES);
which returns as just an empty array? Any help would be great. Thanks!
Add
enctype="multipart/form-data"to your form tag.Spec: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2