Using springboot, how to get the MultipartFile when there names are file1,file2,file3

Viewed 51

I am learning springboot, there is a learning project that used WangEditor(an opensource Rich Text Editor), and I am trying to use the img upload feature

when it's a single-img-upload situation:

    public String imageUpload(@RequestParam(value = "file",required = false) MultipartFile files)

This code runs OK.

But when it's a multi-img-upload situation,The requestParam will be file1,file2,file3 ... MultipartFile[] does not work, so how to solve the problem?

Seems like how to get the unknown param

1 Answers

It solved! add a param: @RequestParam Map<String, MultipartFile> allMultipartFile

Related