总有些奇奇怪怪的转换~
public static File convertMultipartFileToFile(MultipartFile multipartFile) throws IOException { File file = new File(multipartFile.getOriginalFilename()); // 创建一个新的File对象 try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(multipartFile.getBytes()); // 将MultipartFile的字节内容写入到File } return file; }
标签:MultipartFile,File,fos,FileOutputStream,file,multipartFile From: https://www.cnblogs.com/gongjing999/p/17687505.html