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

📄 admin_uploadfilesave.asp

📁 电子书下载系统 后台管理:admin/index.asp 超级用户:admin 密码:admin 请在db/usre.asp,admin/usres更新数据库地址,防止他人下载。 建议把.
💻 ASP
字号:
<!--#include file="db/user.asp" -->
<!--#include file="admin/jl.asp" -->
<!--#include FILE="inc/upload_5xsoft.inc"-->
 <tr> 
<table border="1" width="755" 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%>"><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 getFileExtName(file.fileName)="asp" 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         ''如果 FileSize > 0 说明有文件数据
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 + -