MultipartFile转换成base64

原文链接: https://blog.csdn.net/Yang_Hui_Liang/article/details/86609673

转:https://blog.csdn.net/Yang_Hui_Liang/article/details/86609673

public String test(MultipartFile file) throws Exception{
        BASE64Encoder base64Encoder =new BASE64Encoder();
        String base64EncoderImg = file.getOriginalFilename()+","+ base64Encoder.encode(file.getBytes());
        return base64EncoderImg;

}

你可能感兴趣的:(MultipartFile转换成base64)