download.jsp

来自「用ECLIPSE开发的WEB」· JSP 代码 · 共 60 行

JSP
60
字号
<%--
	* 创建人:lvbo
	* 创建时间:2006-09-12
	* 功能说明:文档下载页面
    * 修改日志:
	* 修改原因:
--%>
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.io.File"%>
<%@ page import ="java.util.*"%>
<%@ page import ="com.ge.common.util.DataUtil"%>
<%@ page import="com.ge.jspsmart.upload.SmartUpload"%>
<%
	String strBasicPath = "";
	String strDocName = "";
	String strSysDate = "";
	String strLoginName = "";
	String strPath = "";
	String strBackupPath ="";
	SmartUpload su = new SmartUpload();
	DataUtil du = new DataUtil();
%>
<%
try{
	request.setCharacterEncoding("GBK");
	
	strDocName = "";
	strDocName=request.getParameter("FileName");
	strBasicPath = request.getRealPath("/");
	//获取配置文件路径
	HashMap hm = du.getConfigFile();
	
	String strTemplatePath = (String)hm.get("from");
	strPath = strTemplatePath+"\\"+strDocName;
	//如果文件不存在将其拷贝过来从备份路径
	File f = new File(strPath);
	if(!f.exists())
		response.sendRedirect("/ASPSERVICE/htmlui_en/selfcare/onlinecommunicate/error.jsp?ErrorMessage=4");
	else
	{
			
		su.initialize(pageContext); 			
		String strRet = su.downFile(strPath,strDocName);
	
	}
%>
<html>
<head>
<title>文档下载页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"></head>

<body>

</body>
</html>
<%
} catch(Exception e) {
    e.printStackTrace();
}
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?