public String test(MultipartFile file) throws Exception{ BASE64Encoder base64Encoder =new BASE64Encoder(); String base64EncoderImg = file.getOriginalFilename()+","+ base64Encoder.encode(file.getBytes()); return base64EncoderImg; }
通过上面的这种方式,可以将MutipartFile转换成base64
原文:https://www.cnblogs.com/qingmuchuanqi48/p/11839300.html