0

The JSON object I'm sending something looks like this

[
 {'fileName':'nameOftheFile1','file':audio_file1}, 
 {'fileName':'nameOftheFile2','file':audio_file2}
]

I tried using Wrapper methods for JSON object but didn't work

This is the link to what I tried receiving json and deserializing as List of object at spring mvc controller

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

0

I would suggest using a MultipartFile for the audios. See the below snippet for an example.

@PostMapping("/uploadFile")
public void uploadFile(@RequestParam("files") MultipartFile[] files) {
     Arrays.stream(files)
           .forEach(file -> {
                //get filename with file.getOriginalFilename()
            });
}