public String test(MultipartFile file) throws Exception{ BASE64Encoder base64Encoder =new BASE64Encoder(); String base64EncoderImg = file.getOriginalFilename()+","+ base64Encoder.encode(file.getBytes()); return base64EncoderImg; }
通过上面的这种方式,可以将MutipartFile转换成base64