⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_uploadfilesave.asp

📁 庐江二中
💻 ASP
字号:
<%PageName="admin_upload"%>
<!--#include file="session.asp"-->
<%checkAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->
<!--#include FILE="inc/upload_5xsoft.inc"--><br>
<table border="1" width="80%" cellspacing="0" cellpadding="1" bgcolor="<%=MainBgColor%>">
<tr>
<td align=center valign=top>
<table border="1" width="100%" cellspacing="0" cellpadding="0" Class="TableLine" bordercolorlight="<%=MainBColor%>" bgcolor="<%=MainCColor%>">
<tr>
<td width="100%" height="20" colspan=2 align=center bgcolor="<%=MainTColor%>" background="images/admin/b3.gif"><b>上 传 结 果</b></td>
</tr>
<tr>
<td width="100%">
<table width="100%" border="1" cellspacing="0" cellpadding="1" align="center" bgcolor="<%=MainBgColor%>">
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_5xSoft 

if upload.form("filepath")="" then
%>
<script language=javascript>
history.back()
alert("请确认上传目录存在!")
</script>
<%
Response.End
else
formPath=upload.form("filepath")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if

iCount=1
response.write "<tr align=center><td>源文件</td><td>文件大小</td><td>上传路径</td><td>目的文件</td><td>上传结果</td></tr>"
for each formName in upload.file 
set file=upload.file(formName)

if file.fileName<>"" then
if instr("asp,asa,css",getFileExtName(file.fileName))=0 then	'-------在此行的引号内添加受限的文件格式----------
response.write "<tr align=center ><td>"&file.FileName&"</td><td>"&file.FileSize&"</td><td>-</td><td><font color=red>受限文件</font></td><td><font color=red>失败!</font></td></tr>"
else
if file.FileSize>0 then
file.SaveAs Server.mappath(formPath&file.FileName)
response.write "<tr align=center ><td>"&file.FileName&"</td><td>"&file.FileSize&"</td><td>"&Server.mappath(formPath)&"</td><td>"&file.FileName&"</td><td>成功!</td></tr>"
end if	
end if
else
Response.Write "<tr align=center><td><font color=red>没有选择</font></td><td>-</td><td>-</td><td>-</td><td><font color=red>失败!</font></td></tr>"
end if
iCount=iCount+1
set file=nothing
next
set upload=nothing
%>
</table></td></tr><td height='27' align='center'><%=iCount-1%>个文件上传结束!</td></tr>
<%
function getFileExtName(fileName)
dim pos
pos=instrrev(filename,".")
if pos>0 then
getFileExtName=mid(fileName,pos+1)
else
getFileExtName=""
end if
end function
%>
</table>
</td>
</tr>
</table>
<%set rs=nothing%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -