⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attach.jsp

📁 tomcat最新安装程序
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.util.*,cn.com.aheadsoft.util.*,cn.com.aheadsoft.business.RecordAttachmentBusiness,cn.com.aheadsoft.recordset.RecordAttachmentRecordSet,java.text.DateFormat,cn.com.aheadsoft.recordset.DetailRecordSet,cn.com.aheadsoft.recordset.DEAimRecordSet,cn.com.aheadsoft.util.StringFormat" %>
<%  
	RecordAttachmentRecordSet DeAimAttachSet = new RecordAttachmentRecordSet();
        RecordAttachmentBusiness m_RecordAttachmentBusiness = new  RecordAttachmentBusiness();
         RecordAttachmentRecordSet m_RecordAttachmentRecordSet = new   RecordAttachmentRecordSet();
         m_RecordAttachmentBusiness.setQueryWhereID(request.getParameter("id"));
         int flag = m_RecordAttachmentBusiness.execute("query");
         DeAimAttachSet = m_RecordAttachmentBusiness.getRARecordSet();
	 DeAimAttachSet.beforefirst();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="/krm/jsp/css/css.css">
<script language="JavaScript" type="text/JavaScript">
	function openWin(url) {
		window.open(url,'','toolbar=no,location=no,menubar=no,resizable=1,scrollbars=yes,left=0,top=0,width=600,height=400');
	}
</script> 
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  cellpadding="0" cellspacing="0"  >
  <tr  class="common">
    <td class="common" valign="middle" align="left">
	<% while(DeAimAttachSet.next()){ 
	     String str =DeAimAttachSet.getRA_AttachmentPath();
         String separator = java.io.File.separator;
		 String uploadpath="";
		 String FileName="";
		 String FileExt="";
		 if(str!=null){
	     uploadpath = str.substring(0,str.indexOf("\\"));
	     FileName = str.substring(str.lastIndexOf("\\")+1); 
	     FileExt =  str.substring(str.lastIndexOf(".")+1); 
		 }
             
             String rapath = request.getRealPath(separator + "jsp" + separator + "knwmanage" + separator + "knowledge" + separator + "knattachment"); 
             String pathroad=rapath+separator+uploadpath;
	     if(FileExt.equalsIgnoreCase("txt")){
              java.io.File f = new java.io.File(pathroad, FileName);
             if(f.exists()) { //检查是否存在     	
             %>
             [<a href="javascript:openWin('/krm/jsp/knwmanage/knowledge/knattachment/<%=DeAimAttachSet.getRA_AttachmentPath()%>');"><%= StringFormat.Source2GB(DeAimAttachSet.getRA_AttachmentName()) %></a>] 
            <%}else{   	
            %>
             [<a href="javascript:openWin('/krm/jsp/util/info.jsp?msg=对不起,文件可能不存在!');"><%= StringFormat.Source2GB(DeAimAttachSet.getRA_AttachmentName()) %></a>]
             <% }
             %>	            
             <%}else{%>
	        [<% out.println("<a href=\"/krm/jsp/util/attechAccesory.jsp?realpath="+uploadpath+separator+"&filename=" + FileName +"\"\" + target=_blank\">"+StringFormat.Source2GB(DeAimAttachSet.getRA_AttachmentName())+"</a>" );%>]
	     <%
              }
	     }%>     
	</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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