📄 admin_upfile.asp
字号:
<!--#include file="upload.inc"-->
<!--#include file="const.asp"-->
<html>
<head>
<title>文件上传</title>
<link href="image/style.css" rel="stylesheet" type="text/css">
</head>
<body text="#000000" leftmargin="0" topmargin="0" bgcolor="#F4EEE4" class="Utu">
<script>
parent.document.forms[0].Submit.disabled=false;
parent.document.forms[0].Submit2.disabled=false;
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC">
<tr>
<td width="388" align="center" valign="middle">
<%
dim upload,file,formName,formPath,filename,fileExt
set upload=new upload_5xSoft ''建立上传对象
formPath=upload.form("filepath")
methods=upload.form("methods")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.filesize<100 then
response.write "<font class=14p>请先选择你要上传的文件 [ <a onclick=history.go(-1) style='cursor: hand' class=14p>重新上传</a> ]</font>"
response.end
end if
if file.filesize>(MaxFileSize*1024) then
response.write "<font class=14p>文件大小超过了限制 "&CStr(MaxFileSize)&"K [ <a onclick=history.go(-1) style='cursor: hand' class=14p>重新上传</a> ]</font>"
response.end
end if
fileExt=lcase(right(file.filename,3))
arrUpFileType=split(UpFileType,"|")
for i=0 to ubound(arrUpFileType)
if fileEXT=trim(arrUpFileType(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
EnableUpload=false
end if
if EnableUpload=false then
response.write "<font class=14p>只允许上传:" & UpFileType &" 文件类型 [ <a onclick=history.go(-1) style='cursor: hand' class=14p>重新上传</a> ]</font>"
response.end
end if
randomize
ranNum=int(90000*rnd)+10000
filename=formPath&year(now)&month(now)&day(now)&ranNum&"."&fileExt
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(FileName) ''保存文件
if methods = 1 then
response.write "<script>parent.WBTB_Composition.document.body.innerHTML+='<br><a href="& filename &"><img border=0 src=image/"&fileEXT&".gif>点击下载浏览该文件"& filename &"</a>'</script>"
else
response.write "<script>parent.WBTB_Composition.document.body.innerHTML+='<br><img border=0 src="&filename&">'</script>"
end if
if methods <> 1 then
response.write "<script>parent.document.form1.DefaultPic.value='<img src="&FileName&" width=120 height=90 vspace=5 border=0>'</script>"
end if
end if
set file=nothing
next
set upload=nothing ''删除此对象
if methods <> 1 then
Response.Write "<a href=admin_upload.asp><span class=14p>上传成功 返回</span></a>"
else
Response.Write "<a href=admin_uploadF.asp><span class=14p>上传成功 返回</span></a>"
end if
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -