我有以下控制器:
@PostMapping(value = "/load_attachment")
public DeferredResult uploadingPost(@RequestParam("attachment") MultipartFile[] uploadingFiles, @RequestParam("stoneId") String stoneId) throws IOException {
logger.info("Upload {} files for stone: {}", uploadingFiles.length, stoneId);
for (MultipartFile uploadedFile : uploadingFiles) {
File file = new File(uploadedFile.getOriginalFilename());
uploadedFile .transferTo(file);
logger.info("path:{}", file.getAbsolutePath()); // I expect to find files here
}
}
没有异常发生,但我无法在文件系统上找到文件。
答案 0 :(得分:0)
在您的情况下,应用程序服务器不在文件夹路径中的应用程序服务器,因此您应手动指定它!...
Environment.getProperty("myCollection", Set.class)