📄 attach.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.util.*,cn.com.aheadsoft.util.*,cn.com.aheadsoft.business.DeInforAttachmentBusiness,cn.com.aheadsoft.recordset.DeInforAttachmentRecordSet,java.text.DateFormat,cn.com.aheadsoft.recordset.DetailRecordSet,cn.com.aheadsoft.recordset.DEAimRecordSet,cn.com.aheadsoft.util.StringFormat" %>
<%
DeInforAttachmentRecordSet DeAimAttachSet = new DeInforAttachmentRecordSet();
DeInforAttachmentBusiness m_DeInforAttachmentBusiness = new DeInforAttachmentBusiness();
DeInforAttachmentRecordSet m_DeInforAttachmentRecordSet = new DeInforAttachmentRecordSet();
m_DeInforAttachmentBusiness.setQueryWhereID(request.getParameter("id"));
int flag = m_DeInforAttachmentBusiness.execute("query");
DeAimAttachSet = m_DeInforAttachmentBusiness.getDIRecordSet();
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" height="100%" >
<tr class="common">
<td class="common" valign="middle" align="left">
<% while(DeAimAttachSet.next()){
String str =DeAimAttachSet.getDI_AttachmentPath();
String separator = java.io.File.separator;
String uploadpath = str.substring(0,str.indexOf("/"));
String FileName = str.substring(str.lastIndexOf("/")+1);
String FileExt = str.substring(str.lastIndexOf(".")+1);
String rapath = request.getRealPath(separator + "jsp" + separator + "tskmanage" + separator + "detail" + separator + "upload");
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/tskmanage/detail/upload/<%=DeAimAttachSet.getDI_AttachmentPath()%>');"><%= StringFormat.Source2GB(DeAimAttachSet.getDI_AttachmentName()) %></a>]
<%}else{
%>
[<a href="javascript:openWin('/krm/jsp/util/info.jsp?msg=对不起,文件可能不存在!');"><%= StringFormat.Source2GB(DeAimAttachSet.getDI_AttachmentName()) %></a>]
<% }
%>
<%}else{%>
[<% out.println("<a href=\"/krm/jsp/util/detailattechAccesory.jsp?realpath="+uploadpath+separator+"&filename=" + FileName +"\"\" + target=_blank\">"+StringFormat.Source2GB(DeAimAttachSet.getDI_AttachmentName())+"</a>" );%>]
<%
}
}%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -