JSP流的方式下载文件<%@ page import="java.io.*" %>
JSP流的方式下载文件
<% 
JSP流的方式下载文件
// example: 
JSP流的方式下载文件
// <a href="download.JSP?path=img/&name=test.gif">download image</a> 
JSP流的方式下载文件

JSP流的方式下载文件String root 
= getServletContext().getRealPath("/"); 
JSP流的方式下载文件String path 
= request.getParameter("path"); 
JSP流的方式下载文件String name 
= request.getParameter("name"); 
JSP流的方式下载文件System.out.println(root 
+ path + name);
JSP流的方式下载文件
JSP流的方式下载文件response.setContentType(
"unknown"); 
JSP流的方式下载文件response.addHeader(
"Content-Disposition""attachment;filename=\"" + name + "\""); 
JSP流的方式下载文件
JSP流的方式下载文件
try 
%>

相关文章:

  • 2021-11-06
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-09-16
相关资源
相似解决方案