//本地windows系统,项目要部署在linux系统。
public Map<String, Object> uploadFile(HttpServletRequest request, MultipartFile uploadFile, Long id,String targetPath) {
Map<String, Object> resultMap = new HashMap<>();
String path = null;
String os = System.getProperties().getProperty("os.name");
//判断系统是windows,还是linux系统
if (!os.toLowerCase().startsWith("win")) {
// linux
path = targetPath;//-----/home/admin/upload
} else {
path = request.getSession().getServletContext().getRealPath("upload");
}
log.info("========path=========" + path);
String originalFilename = uploadFile.getOriginalFilename();
String fileTyle = originalFile