接口接收文件
@RequestParam("file") MultipartFile file
MultipartFile转byte[]
String name = file.getName(); String originalFilename = file.getOriginalFilename(); String contentType = file.getContentType(); String bytes = file.getBytes();
byte[]转MultipartFile
InputStream inputStream = new ByteArrayInputStream(bytes); MultipartFile file = new MockMultipartFile(name, originalFilename, contentType, inputStream);
标签:Web,String,file,互转,byte,MultipartFile From: https://www.cnblogs.com/yangchongxing/p/17425586.html