Activiti导出模型文件xml(xml文件超过10K),activiti6导出模型是浏览器直接打开

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();

猜你喜欢

转载自blog.csdn.net/qq_25983579/article/details/114117791