文件上传

This commit is contained in:
JinLu.Yin
2022-07-27 20:48:50 +08:00
parent 3e93c9e0a2
commit 3a46ad74a2
6 changed files with 255 additions and 0 deletions

View File

@@ -161,4 +161,20 @@ public class CommonController
log.error("下载文件失败", e);
}
}
@PostMapping("/uploadMinio")
public AjaxResult uploadFileMinio(MultipartFile file) throws Exception{
try{
String fileName = FileUploadUtils.uploadMinio(file);
AjaxResult rt = AjaxResult.success();
rt.put("url",fileName);
rt.put("fileName",fileName);
rt.put("newFileName",FileUtils.getName(fileName));
rt.put("originalFileName",file.getOriginalFilename());
return rt;
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
}