2020
10-10
10-10
Java中将File转化为MultipartFile的操作
话不多说直接上代码,简单明了importjava.io.File;importjava.io.FileInputStream;importorg.springframework.web.multipart.MultipartFile;importorg.springframework.mock.web.MockMultipartFile;importorg.apache.http.entity.ContentType;FilepdfFile=newFile("D://test.pdf");FileInputStreamfileInputStream=newFileInputStream(pdfFile);MultipartFilemultipartFile=newMockMultipartFile(pdfFile.getNam...
继续阅读 >