SmartUpload 文件下载

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.jspsmart.upload.*"%>
<%
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
String path = request.getParameter("path");
//新建一个SmartUpload对象
SmartUpload su = new SmartUpload();
//初始化
su.initialize(pageContext);
//设定要下载的文件名(带路径)
String fileName = path;//文件名(带路径)
try{
su.downloadFile(fileName);//下载文件
}catch(Exception e){
e.printStackTrace();
out.println(e.toString());
}
response.getOutputStream().close();
%>
<head>
</head>

你可能感兴趣的:(html)