String video = "";//base64编码的视频 //拼接路径 String filePath = PathUtil.getImgBasePath() + File.separator + certification.getNumber() + File.separator + "legalVideo.MP4"; //文件写入 Files.write(Paths.get(filePath), java.util.Base64.getDecoder().decode(video), StandardOpenOption.CREATE);