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

📄 admin_uploadimgsave.asp

📁 庐江二中
💻 ASP
字号:
<%PageName="admin_upload"%>
<!--#include file="session.asp"-->
<%checkAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="function.asp"-->
<!--#include file="top.asp"-->

<%
NewsID=request("NewsID")
FilePath=ImgPath
if FilePath="" then
%>
<script language=javascript>
history.back()
alert("请确认上传目录存在!或者“网站资料管理”中图片目录设置是否正确")
</script>
<%
Response.End
end if

Savepath=server.MapPath(FilePath)
iCount=1
set FileUp=server.createobject("ChinaASP.UpLoad")
%>
<table border="1" width="100%" 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%>">
<tr align=center><td>源文件</td><td>文件大小</td><td>上传路径</td><td>目的文件</td><td>上传结果</td></tr>
<%
for each f in fileup.Files


if f.isempty=false then
if instr("gif,bmp,jpg,swf,png",getFileExtName(f.fileName))=0 then
response.write "<tr align=center ><td>"&f.FileName&"</td><td>"&f.FileSize&"</td><td>-</td><td><font color=red>受限文件</font></td><td><font color=red>失败!</font></td></tr>"
else
if f.filesize<>0 then
f.saveas SavePath & "/"&NewsID & "-" & cstr(iCount)&"."& getFileExtName(f.fileName)		
response.write "<tr align=center ><td>"&f.FileName&"</td><td>"&f.FileSize&"</td><td>"&Savepath&"</td><td>"&NewsID & "-" & cstr(iCount)&"."& getFileExtName(f.fileName)&"</td><td>成功!</td></tr>"
else
Response.Write "<tr align=center><td>"&f.FileName&"</td><td>0</td><td>-</td><td>-</td><td><font color=red>失败!</font></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
next
%>
</table></td></tr><td height='27' align='center'>总共用去时间: <%=fileup.UsedTime%>秒!</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

set fileup=nothing
%>
</table>


</td>
</tr>
</table>
<%set rs=nothing%>

⌨️ 快捷键说明

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