Send multiple fields with the same name via jQuery
Posted
by
Swell
on Stack Overflow
See other posts from Stack Overflow
or by Swell
Published on 2010-12-24T11:49:20Z
Indexed on
2010/12/24
11:54 UTC
Read the original article
Hit count: 160
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,
© Stack Overflow or respective owner