## 整个请求所有的大小
spring.servlet.multipart.max-request-size=10MB
## 单个文件大小
spring.servlet.multipart.max-file-size=10MB
@PostMapping("/upload1")
@Transactional
public RspDTO uploadFileNew(
@RequestParam("followId") String followId,
@RequestParam("type") String type,
@RequestPart("files") MultipartFile[] fileArr,
@RequestPart("file") MultipartFile file,
HttpServletRequest request) {
if (!file.isEmpty()) {
try {
file.transferTo(new File("/usr"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
if (fileArr.length>0) {
for (MultipartFile multipartFile : fileArr) {
if (!multipartFile.isEmpty()){
}
}
return RspDTO.success();
}
return null;
}