Activiti导出超过10K的xml文件时,response 要在获取输出流之前设置header格式
原代码为:
ByteArrayInputStream in = new ByteArrayInputStream(exportBytes);
IOUtils.copy(in, response.getOutputStream());
response.setHeader("Content-Disposition", "attachment; filename="+ filename);
response.flushBuffer();
修改后,代码为:
ByteArrayInputStream in = new ByteArrayInputStream(exportBytes);
response.setHeader("Content-Disposition", "attachment; filename="+ filename);
IOUtils.copy(in, response.getOutputStream());
response.flushBuffer();
时间: 2024-10-20 03:51:25