VUE3知识点
# 批量上传
@PostMapping("/uploadStrategyBatch")
public Rep<List<String>> uploadStrategyBatch(@RequestParam("file") MultipartFile[] file, @RequestParam("path") String path, HttpServletRequest httpServletRequest ) throws IOException, BasicException {
return Rep.ok(fileService.uploadStrategyBatch(file, path, httpServletRequest));
}
1
2
3
4
2
3
4
最主要的就是把文件往这个 file 里面塞,你觉得这样会覆盖?其实并不会,这就是批量上传。
let fd = new FormData();
for (let i = 0; i < files.length; i++) {
fd.append('file', files[i])
}
1
2
3
4
2
3
4
上次更新: 4/1/2025, 5:03:02 PM