Hello, please check, if this can help you :).
test.html
=========
<html>
<body>
<form action="test.php" method="post" enctype="multipart/form-data">
Upload multiple files:<br />
<input name="userfile[]" type="file" multiple="multiple" /><br />
<input type="submit" value="Upload" />
</form>
</body>
</html>
test.php
========
if ($_FILES['userfile']) {
$file_ary = reArrayFiles($_FILES['userfile']);
foreach ($file_ary as $file) {
print 'File Name: ' . $file['name'] . '<br />';
print 'File Type: ' . $file['type'] . '<br />';
print 'File Size: ' . $file['size'] . '<br /><hr />';
}
}
function reArrayFiles(&$file_post) {
$file_ary = array();
$file_count = count($file_post['name']);
$file_keys = array_keys($file_post);
for ($i=0; $i<$file_count; $i++) {
foreach ($file_keys as $key) {
$file_ary[$i][$key] = $file_post[$key][$i];
}
}
return $file_ary;
}
?>
This will allow you to upload more than one file on one go, and on submitting, it will show all the details of the file.
I hope this will help you :).