<pre name="code" class="java">service层
@Autowiredprivate
HttpServletRequest request;
String path = request.getServletContext().getRealPath("");//获取项目动态绝对路径
/**
* 下载压缩文件
* @param path request.getServletContext().getRealPath("")
* @param zipName 压缩文件名称
* @return
* @throws Exception
*/
public ResponseEntity<byte[]> download(String path, String zipName) throws Exception {
HttpHeaders headers = new HttpHeaders();
String filePath = null;
filePath = path + "/resources/excelzip/" + zipName + ".zip";
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", new String(