I have an angularjs application that adds attachments to a formData and sends it to my symfony controller. To get the uploads and to loop over the multiple uploads from the post, i'm using:
$request->files->all();
and tried:
$request->files;
When i loop over the attachments, symfony is only returning 1 upload? When I check the payload from my Angular app, it shows 2+ files being sent? Shouldn't both of the files be in the Symfony filebag? The API documents show that it should be an array of the files.
Here is a test controller i have been using to try and display the names of the files being uploaded. So far it only shows the last file uploaded.
public function saveAttachment(Request $request) {
$files = $request->files->all();
foreach ($files as $file) {
echo $file->getClientOriginalName();
echo "<br>";
}
exit;
}
I'm not using Symfony forms to generate my HTML, it is separate from the Symfony app.