www.gusucode.com > 掌柜网店购物系统 4.0码程序 > admin/upload1.asp

    <%OPTION EXPLICIT%>
<!--#include file="include.asp"-->
<!--#include file="upload_godbook.inc"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"
response.End
end if
end if%>
<html>
<head>
<title>商品文件上传</title>
<style>
BODY {
SCROLLBAR-FACE-COLOR: #e7e7e7;  
SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
SCROLLBAR-SHADOW-COLOR: #d4d0c8;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR:  #ffffff;
SCROLLBAR-TRACK-COLOR: #f7f7f7;
SCROLLBAR-DARKSHADOW-COLOR: #e7e7e7; 
}
.style3 {color: #FF6600}
</style>
</head>
<body>
<%
dim upload,file,formName,formPath,iCount,act,iFail
set upload=new upload_5xSoft

response.write "<br><br>"&upload.Version&"<font size=2>"

if upload.form("filepath")="" then
 HtmEnd "请输入要上传至的目录!",1,""
 set upload=nothing
 response.end
else
 formPath=upload.form("filepath")
 ''在目录后加(/)
 if right(formPath,1)<>"/" then formPath=formPath&"/"
 act=procCheckDir(formpath,1)
 if act<>"ok" then htmEnd "错误! "&act,1,""
end if

iCount=0
iFail=0
for each formName in upload.file
 set file=upload.file(formName)
 if file.FileSize>0 then
  act=procCheckFile(file.FileName,0)
  response.write "<font size=2>"&file.FilePath&file.FileName&",大小:"&file.FileSize&" => "&formPath&File.FileName&"</font>"
  if act="ok" then
   file.SaveAs Server.mappath(formPath&file.FileName)
   response.write " <font color=#0000ff size=2>成功!</font>"
   iCount=iCount+1
  else
   response.write " <font color=#ff0000 size=2>失败! "&act&"</font>"
   iFail=iFail+1
  end if
 end if
 set file=nothing
next
set upload=nothing  ''删除此对象
response.write "<br><font size=2>"&iCount&" 个文件上传成功! "&iFail&"个文件上传失败</font></font>"
%><br>
<input type=button value=返回 onclick="location.href='upfile.asp';">
<input type=button value=关闭 onclick="window.close();">
<script language=javascript>
if(window.opener&&window.opener.refreshit)
 window.opener.refreshit();
</script>
<%htmEnd "",0,""%>
</body>
</html>