downloadInterviewFile() throws Exception { // 根据面试官主键编码 下载文件 ..._responseentity批量下载">
赞
踩
我看了很多网上的demo,先生成ZIP压缩文件,然后再下载。我这里是生成ZIP文件流 进行下载。(核心代码没多少,就是一些业务代码)
- @RequestMapping(value = "/")
- public ResponseEntity<byte[]> downloadInterviewFile() throws Exception {
- // 根据面试官主键编码 下载文件
- List<InterviewFile> interviewFiles = this.interviewFileService.getAll(interviewfile);
-
- ByteArrayOutputStream byteOutPutStream = null;
-
- if (!interviewFiles.isEmpty()) {
- //单个文件名称
- String interviewFileName = "";
- //文件后缀
- String fileNameSuffix = "";
- //创建一个集合用于 压缩打包的参数
- List<Map<String, String>> parms = new ArrayList<>();
- //创建一个map集合
- Map<String, String> fileMaps =null;
- //得到存储文件盘符 例 D:
- String root = properties.getValue(&#
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。