Send multiple fields with the same name via jQuery
- by Swell
Hi,
how to send multiple fields with the same name via jQuery like this:
<input type="file" name="file[]" />
<input type="file" name="file[]" />
<input type="file" name="file[]" />
jQuery:
function upload() {
$.post('upload.php', { file[]: uplaodForm.file[].value },
function(output) {
$('#result').html(output).show();
});
}
upload.php:
$file[$i] = $_FILES['file']['name'][$i];
thank you,