📄 upload_exe.asp
字号:
<!--#include file="../config2.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 4000300 '本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID) then '验证权限
Server.Transfer "../err/un_authorized.htm"
response.end
end if
%>
<!--**************身份验证部分****************-->
<!--#include FILE="asp_upload_class.asp"-->
<%
'on error resume next
'获得文档编号
Document_ID = request.Cookies("Document_ID")
set upload = new upload_5xSoft ''建立上传对象
for each formName in upload.file
set file = upload.file(formName) ''生成一个文件对象
fileExt=lcase(right(file.filename,4))
uploadsuc=false
Forumupload=split("doc,xls,gif,jpg,mdb,pdf,ppt,txt,rar,zip",",")
for i=0 to ubound(Forumupload)
if fileEXT="."&trim(Forumupload(i)) then
uploadsuc=true
exit for
else
uploadsuc=false
end if
next
if uploadsuc=false then
response.write "文件格式不正确 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
response.end
end if
if file.FileSize > 0 then ''如果 FileSize > 0 说明有文件数据
'全文件名
s = split(file.FileName,".",-1,1)
'取得扩展名
ext = s(1)
'保存路径
SavePath = Server.mappath("../upload_documents/attch_" & Document_ID & "." & ext) ''保存文件路径
'response.write SavePath
file.SaveAs SavePath
Source_File = file.FilePath & file.FileName
File_Size = file.FileSize
if err.description = "" then
'修改数据库相应记录
Set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
'update Documents set Document_Type = @Ext where Document_ID = @Document_ID
'sql = "sp_Document_Modi_Document_Type " & Document_ID & ",'" & ext & "'"
sql = "update Documents set Document_Type = '" & ext & "' where Document_ID = " & Document_ID
'response.write sql
conn.execute(sql)
conn.close
set conn = nothing
msg = "文件上传成功!"
end if
response.write err.description
end if
next
set file=nothing
set upload=nothing ''删除此对象
'操作日志
Rec_Content = "上传文件"
Command_Line = sql
call Op_Rec(Rec_Content,Command_Line)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<%= msg %>
<hr size=1>
<table border=0 cellpadding=1 cellspacing=1 bgcolor="#BBBBBB" width="100%">
<tr>
<td bgcolor="#EFEFEF">来源:</td>
<td bgcolor="#FFFFFF"><%= Source_File %></td>
</tr>
<tr>
<td bgcolor="#EFEFEF">保存为:</td>
<td bgcolor="#FFFFFF"><%= ServerRoot & "/" & "upload_documents/attch_" & Document_ID & "." & ext %></td>
</tr>
<tr>
<td bgcolor="#EFEFEF"><nobr>文件大小:</nobr></td>
<td bgcolor="#FFFFFF"><%= File_Size %> Bytes</td>
</tr>
</table>
</body>
</html>
<script language="JavaScript" type="text/javascript">
parent.main.location.reload();
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -