What I'm trying to do upload multiple images from a single click using POST method. Path of each image saving in Database as I want to but nothing getting stored on that local folder path. I am taking multiple images from multiple inputs, not from the single input.
Input File to upload single then click on ADD to add another from another file_input tag.. and so on.
Array ( [0] => Array ( [attachment] => 8.jpg ) [1] => Array ( [attachment] => 3-D80A.JPG ) )
Front
<form method="post" action="">
<input type="file" id="file" name="attachment[0][attachment]">
<input type="file" id="file" name="attachment[1][attachment]">
<input type="submit" name="submit_case" value="Save" class="btn btn-primary">
</form>
Back
foreach (array_keys($_FILES["attachment"]["name"]) as $fieldKeysymtoms) {
foreach ($_FILES["attachment"]["name"][$fieldKeysymtoms] as $key=>$value) {
print_r($_FILES["attachment"]["name"][$fieldKeysymtoms]);
if(move_uploaded_file($_FILES["attachment"]["tmp_name"][$fieldKeysymtoms], "app-assets/images/".$name)){
$uploads = "app-assets/images/".$name;
}
$json_symtoms_array+=array($fieldKeysymtoms => $value);
}
}