需要导出一些图片和一个文本,一起放到zip压缩包中
@GetMapping("/downloadZip")
public void downloadZip(HttpServletResponse response) throws IOException {
//指明response的返回对象是文件流
response.setCharacterEncoding("UTF-8");
response.setContentType("application/octet-stream");
//设置在下载框默认显示的文件名
response.setHeader("Content-Disposition", "attachment;filename=" + <