JAVA FIie类型转MultipartFile

FIie类型转MultipartFile

File filexxx = new File(“文件路径”);
FileInputStream fileInputStream = new FileInputStream(filexxx);
MultipartFile multipartFile = new MockMultipartFile(filexxx.getName(), filexxx.getName(),
    ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);

你可能感兴趣的:(JAVA FIie类型转MultipartFile)