Http前端请求文件下载(代码)
前端http访问后端进行文件下载功能,主要需要设置http相关相应参数,主要方法代码如下:/**** str 自定义导出的内容模板格式* fileName 文件名* **/public void exportFile(String str,String fileName) throws IOException { HttpServletResponse response = super.getResponse(); response.setContentType("text/plain"
原创
2020-07-31 17:46:37 ·
794 阅读 ·
0 评论