直接通过Response输出流写文件,浏览器表现为下载文件

mac2022-06-30  30

response.setContentType("application/x-download"); response.addHeader("Content-Disposition", "attachment;filename="+new String( "中文".getBytes("utf-8"), "ISO8859-1" )+"文件类型");

OutputStream out = response.getOutputStream();

向out中写入流

out.flush();

response.flushBuffer();

即可

转载于:https://www.cnblogs.com/guangshan/p/4654972.html

相关资源:Qt QListWidget和QStackedWidget用法
最新回复(0)