📄 upgongwenpostcopy.asp
字号:
<!--#include file="../../Connections/oavbsconn.asp" -->
<!--#include file="../../Connections/leq.asp" -->
<%
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include FILE="upload_5xsoft.inc"-->
<html>
<head>
<title></title>
<style type="text/css">
<!--
td { font-size: 12px; line-height: 17px }
body { font-size: 12px; line-height: 17px }
p { margin-top: 1; margin-bottom: 1 }
a:link { text-decoration: none; color: black }
a:visited { text-decoration: none; color: black }
a:hover { text-decoration: underline; color: red }
-->
</style>
<link href="../../css/input.css" rel="stylesheet" type="text/css">
<link href="../../css/link.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
.style2 {color: #FF0000}
-->
</style>
</head>
<body>
<br>
<%
Server.ScriptTimeout=900
dim upload,file,formName,formPath,iCount,fileformat
set upload=new upload_5xSoft ''建立上传对象
if upload.form("filepath")="" then ''得到上传目录
HtmEnd "请输入要上传至的目录!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")
if upload.form("filepath")="" then
Response.Write("<script>alert(""请选择制度文件!"");location=""javascript:history.back()"";</script>")
Response.End
end if
shuoming=upload.form("文件说明")
bumen=upload.form("上传人部门")
xingming=upload.form("发送人姓名")
zhanghao=upload.form("发送人帐号")
riqi=date()
xingming=upload.form("发送人姓名")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
fileformat=lcase(right(file.filename,4))
fileformat111=lcase(right(file.filename,5))
%>
<%
dim flength,fpath,fname
if file.FileSize>0 then
flength=cint(file.FileSize/1024)
fpath=formPath&File.FileName
fname=file.FileName
session("fnamesgongxiang")=fname
Dim datalog__MMColParam
datalog__MMColParam = "1"
If (file.FileName <> "") Then
datalog__MMColParam = file.FileName
End If
Dim datalog
Dim datalog_numRows
Set datalog = Server.CreateObject("ADODB.Recordset")
datalog.ActiveConnection = MM_oavbsconn_STRING
datalog.Source = "SELECT * FROM 学院制度文件 WHERE 文件名 = '" + Replace(datalog__MMColParam, "'", "''") + "'"
datalog.CursorType = 0
datalog.CursorLocation = 3
datalog.LockType = 3
datalog.Open()
if not datalog.eof then
response.Redirect("wrong.asp")
end if
on error resume next
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
if err.number<>0 then
response.write"<script>alert('"&Session("names")&"很抱歉,您上传的文件"&file.FileName&"含有,.;等非法字符,请去掉该类字符继续上传,谢谢!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end()
end if
response.write file.FilePath&file.FileName&" ("&cint(file.FileSize/1024)&"K) 成功!<br>"
iCount=iCount+1
dim total
total=1
dim ks
ks="k"
do while total<=iCount and datalog.eof
datalog.addnew
total=total+1
datalog("文件路径")=fpath
datalog("文件名")=file.FileName
datalog("上传人帐号")=upload.form("发送人帐号")
datalog("上传人姓名")=upload.form("发送人姓名")
datalog("上传人部门")=upload.form("上传人部门")
datalog("上传日期")=date()
datalog("备注")=upload.form("文件说明")
datalog("上传年份")=year(now())
datalog("上传月份")=month(now())
datalog("上传日")=day(now())
if session("bumen")="院领导" then
datalog("制度属性")="学院"
else
datalog("制度属性")=upload.form("制度属性")
end if
if flength=0 then
flength=1
end if
datalog("文件大小")=flength&"KB"
datalog.update
datalog_numRows = 0
loop
end if
set file=nothing
next
set upload=nothing ''删除此对象
Htmend iCount&" 个文件上传结束!"
sub HtmEnd(Msg)
set upload=nothing
response.write "<br>"&Msg&" [<a href=""javascript:history.go(-1)"">返回</a>]</body></html>"
end sub
%>
<br>
<span class="style1"><img src="../jfoanet/img/978.gif" width="27" height="24"><%= Session("names") %></span><span class="style2">恭喜您:</span>文件上传成功
<hr size=1 noshadow width=300 align=left>
<p><br>
<br>
<p> </p>
<p> </p>
</body>
</html>
<%
datalog.Close()
Set datalog = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -