springboot多文件上传

后端代码

@RequestMapping(value = "/upload", method = RequestMethod.POST)
public ResultVo upload(@Valid UploadRequestVo uploadRequestVo, @RequestParam("file") MultipartFile[] files, HttpServletRequest request) {
        ResultVo data = fileService.uploadPic(uploadPictureRequestVmo, files, headers);       
        return data ;
}

配置文件

控制文件上传大小:
在application.yml中配置

spring:
	servlet:
	    multipart:
	      max-file-size: 20MB #单个文件上传大小
	      max-request-size: 600MB #连续上传文件大小

你可能感兴趣的:(springboot多文件上传)