|
@@ -49,11 +49,9 @@ public class DownloadController {
|
|
String resultFileName = URLEncoder.encode(fileName, "UTF-8");
|
|
String resultFileName = URLEncoder.encode(fileName, "UTF-8");
|
|
resp.reset();// 清空输出流
|
|
resp.reset();// 清空输出流
|
|
resp.setCharacterEncoding("UTF-8");
|
|
resp.setCharacterEncoding("UTF-8");
|
|
-// resp.setHeader("Content-disposition", "attachment; filename=" + resultFileName);
|
|
|
|
-// resp.setContentType("application/txt");
|
|
|
|
- resp.setHeader("Content-Length", String.valueOf(resourceAsStream.available()));
|
|
|
|
- resp.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
|
- resp.setHeader("Content-disposition", "attachment;filename=" + fileName);
|
|
|
|
|
|
+ resp.setHeader("Content-disposition", "attachment; filename=" + resultFileName);
|
|
|
|
+ resp.setHeader("Connection", "close");
|
|
|
|
+ resp.setHeader("Content-Type", "application/octet-stream");
|
|
out = resp.getOutputStream();
|
|
out = resp.getOutputStream();
|
|
int len;
|
|
int len;
|
|
byte[] buffer = new byte[1024];
|
|
byte[] buffer = new byte[1024];
|