如何将MultipartFile转换成based4

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

通过上面的这种方式,可以将MutipartFile转换成base64

posted @ 2019-11-12 00:05  King-DA  阅读(1819)  评论(0编辑  收藏  举报