How to upload multiple Files with getUploadedFiles()



I’m trying to upload multiple files but I see that getUploadedFiles() only gets one file.

This is my code:

 $files = $request->getUploadedFiles();


And I’m using Postman like this example ( and choosing several files

Thanks in advance!


Hi @josvan did you figure this out?


Same thing was happening to me when i had input set like this:
<input type="file" name="gallery" multiple="multiple">
fix was to add “[]” behind name:
<input type="file" name="gallery[]" multiple="multiple">

now getUploadedFiles() shows more than one file,
hope it helps somebody :slight_smile:


You have to set the Content-type of the message as multipart/form-data