Red_A
Red_A

Reputation: 31

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

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

Upvotes: 2

Views: 82

Answers (1)

Red_A
Red_A

Reputation: 31

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

Upvotes: 1

Related Questions