If I use multiple file fields, those can be retrieved by using foreach. This method is working fine.
<input type="file" name="attachFile">
<input type="file" name="attachFile2">
<input type="file" name="attachFile3">
foreach($_FILES as $attachFile)
{
$tmp_name = $attachFile['tmp_name'];
$type = $attachFile['type'];
$name = $attachFile['name'];
$size = $attachFile['size'];
}
If I do the same for HTML5 multiple file field that does not work. Here is the example below that I have no luck with. It does not produce any error either.
<input multiple="multiple" type="file" name="attachFile">
foreach($_FILES['attachFile'] as $attachFile)
{
$tmp_name = $attachFile['tmp_name'];
$type = $attachFile['type'];
$name = $attachFile['name'];
$size = $attachFile['size'];
}
attachFile[]instead ofattachFile- See this answer: stackoverflow.com/a/8725752/921204