导出excel用ajax不行,提交form表单可以。

一直用ajax找原因,网页不出现下载提示框

写了

response.setContentType("application/binary;charset=ISO8859_1");
Date now = new Date();
SimpleDateFormat toDoFormat = new SimpleDateFormat("yyyyMMddhhmmssSSS");
String nowTime = toDoFormat.format(now).toString();
ServletOutputStream outputStream = response.getOutputStream();
String fileName = new String(("88"+nowTime).getBytes(), "ISO8859_1");
response.setHeader("Content-disposition", "attachment; filename=" + fileName + ".xlsx");

提示框就肯定会有了

后来试了下form,成功了

然后百度了下:

http://bbs.csdn.net/topics/391901142



相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2021-08-24
  • 2021-08-14
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-11-19
  • 2021-11-27
  • 2021-12-02
相关资源
相似解决方案