spring boot实现上传和删除照片

spring boot实现上传和删除照片 public static void uploadFile(byte[] file, String filePath

spring boot实现上传和删除照片

public static void uploadFile(byte[] file, String filePath, String fileName) throws Exception {        File targetFile = new File(filePath); if (!targetFile.exists()) {targetFile.mkdirs();    }        FileOutputStream out = new FileOutputStream(filePath +"/"+ fileName);out.write(file);      out.flush();   out.close(); }//处理文件上传@ResponseBody //返回json数据  @RequestMapping(value = "upload", method = RequestMethod.POST) public JSONObject uploadImg(@RequestParam("file") MultipartFile file,HttpServletRequest request) {        String contentType = file.getContentType(); String fileName = System.currentTimeMillis()