特殊狀況下須要作轉換code
一、M轉Fip
File file = new File(path); FileUtils.copyInputStreamToFile(multipartFile.getInputStream(), file);
二、F轉Mget
File file = new File("src/test/resources/input.txt"); FileInputStream input = new FileInputStream(file); MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));