I've got the following form...
<form class="clearfix" action="/application_submit.php" method="post" enctype="multipart/form-data" name="applicationForm" id="applicationForm">
<!-- 100 text/select/option inputs or so that I won't include here... -->
<div class="line">
<div class="unit size1of1">
<label class="field_label" for="freeform_application_attachments">Attachments</label>
<input type="file" name="file_attachments_1" value="" id="freeform_application_attachments0" /><br/>
<input type="file" name="file_attachments_2" value="" id="freeform_application_attachments1" /><br/>
<input type="file" name="file_attachments_3" value="" id="freeform_application_attachments2" /><br/>
<input type="file" name="file_attachments_4" value="" id="freeform_application_attachments3" /><br/>
<input type="file" name="file_attachments_5" value="" id="freeform_application_attachments4" />
</div>
</div>
</form>
And my submit JS...
$('form#applicationForm').validate({
onkeyup: false,
onfocusout: false,
onclick: false,
submitHandler: function(form) {
form.submit();
}
});
And lastly, the content headers that are sent over the wire in my network tab (in this example I am only putting in 2 files):
------WebKitFormBoundaryT5oEIdNCfF7vnxWr
Content-Disposition: form-data; name="file_attachments_1"; filename="lemonone-715d1576013f3260da2afa15a3ce26f03bacac72.zip"
Content-Type: application/zip
------WebKitFormBoundaryT5oEIdNCfF7vnxWr
Content-Disposition: form-data; name="file_attachments_2"; filename="browser marklet.psd"
Content-Type: image/vnd.adobe.photoshop
------WebKitFormBoundaryT5oEIdNCfF7vnxWr
Content-Disposition: form-data; name="file_attachments_3"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryT5oEIdNCfF7vnxWr
Content-Disposition: form-data; name="file_attachments_4"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryT5oEIdNCfF7vnxWr
Content-Disposition: form-data; name="file_attachments_5"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryT5oEIdNCfF7vnxWr--
But on my server, here is what I'm getting...
Which is generated by this code...
echo "\$_FILES array:<br />";
var_dump($_FILES);
So I've got enctype="multipart/form-data"
, I've got my method="POST"
, all my file inputs have names, the HTTP POST
in my network tab says that the request contains the files to be uploaded -- but still, the $_FILES
array is empty on the server-side?
What's going on?