📄 doc_upload.asp
字号:
<%
'************************************************************************************************
' 文件名: doc_a.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
' 创建人 : 周秋舫
' 日 期 : 2002-08-15
' 修改历史 :
' ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 公文登记,并上载公文/附件文件到数据库
' 版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->
<%
'' 检查已经登录并在线
call CheckSecurity()
'' 只有公文管理员或办公室主任才能访问本页
if (not IsDocAdmin) and (not IsOfficer) then
Response.Clear
Response.Redirect("../common/error.asp?error=对不起,您没有权限访问本页!&")
Response.end
end if
'' 检查输入参数,要么是公文标识,要么是附件标识
dim pDocId : pDocId = GetParam("doc_id")
dim pAttachId : pAttachId = GetParam("attach_id")
if IsEmpty(pDocId) and IsEmpty(pAttachId) then
Response.Clear
Server.Transfer("../common/error.asp")
Response.end
end if
dim sPageTitle
dim sSQL, crs, rs, sFileName, sFileLink
if Not IsEmpty(pDocId) then '' 上传公文文件
sPageTitle = "公 文 文 件 上 传"
sSQL = "select doc_subject as filename from t_document where doc_id = " & ToSQL(pDocId, "Number")
elseif Not IsEmpty(pAttachId) then '' 上传公文附件
sPageTitle = "公 文 附 件 上 传"
sSQL = "select attach_subject as filename from t_doc_attachment where attach_id = " & ToSQL(pAttachId, "Number")
end if
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
if rs.EOF then
crs.Close()
Response.Clear
Server.Transfer("../common/error.asp")
Response.end
end if
sFileName = crs.GetValue("filename")
'' 如果有后缀名,则将其后缀去掉,只剩文件名前缀,作为公文主题
'if InstrRev(sFileName, ".") > 0 then sFileName = Left(sFileName, InstrRev(sFileName, ".") -1 )
if Not IsEmpty(pDocId) then
sFileLink = "<a style=""color:blue"" target=_blank href=""content_show.asp?doc_id=" & pDocId & "&"" title=""点击可以阅读文件内容"">" & sFileName & "</a>"
elseif Not IsEmpty(pAttachId) then
sFileLink = "<a style=""color:blue"" target=_blank href=""content_show.asp?attach_id=" & pAttachId & "&"" title=""点击可以阅读文件内容"">" & sFileName & "</a>"
end if
%>
<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../common/common.css" type="text/css">
<style type="text/css">
input {color:blue}
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/bg.gif">
<br>
<%
'********************************************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------------------------
%>
<form name="FormUploadDoc" method="post" enctype="multipart/form-data" action="doc_upload_action.asp">
<input type="hidden" name="doc_id" value="<%=pDocId%>">
<input type="hidden" name="attach_id" value="<%=pAttachId%>">
<table width=480 align=center border=0 cellspacing=1 cellpadding=3 bgcolor="#e0e0e0" style="table-layout:fixed;border:1px solid navy">
<tr bgcolor=navy style="color:white;font-weight:600"><td align=center><%=sPageTitle%></td></tr>
<tr bgcolor=white>
<td> 原来文件为:<%=sFileLink%></td>
<tr bgcolor=white>
<td> 上传文件为:<input type="file" name="content" size=50></td></tr>
<tr bgcolor=white height=30>
<td align=center>
<input type="image" name="Enter" src="../images/button/submit.gif" style="border-width:0">
<img border=0 width=20 height=0>
<img border=0 src="../images/button/cancel.gif" onclick="javascript:window.close();"></td></tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -