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

📄 upfilepro2.asp

📁 电子商城代码
💻 ASP
字号:
<%@ codepage=65001%>
<!--#include file="56770_upload.inc"-->
<link href="../admin/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<BODY TEXT="#000000" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" bgcolor=#E8F1FF>
<%
session.codepage=65001
if session("admin_name")="" then
	response.write "<table width=100% border=0 cellspacing=1 cellpadding=2 bgcolor=#E8F1FF><tr><td height=20>您超时退出,请重新登陆!</td></tr></table>"
else
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#E8F1FF"> 
<%
if request("chuan") = "yes" then
dim upload,file,formName,formPath,iCount,filename,fileExt,AllowExt,cls
set upload=new upload_5xSoft ''建立上传对象
iCount=0
AllowExt="gif,jpg"
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.filesize<10 then
 	response.write "<tr><td height=20>请先选择你要上传的文件![ <a href=# onclick=history.go(-1)>重新上传</a> ]</td></tr>"
	response.end
 end if
 	
 fileExt=lcase(right(file.filename,3))
 cls = Instr(AllowExt,fileExt)
 if cls <= 0 then
 	response.write "<tr><td height=20>您上传的图片格式不支持,只能上传jpg和gif文件![ <a href=# onclick=history.go(-1)>重新上传</a> ]</td></tr>"
	response.end
 elseif file.filesize>10240000 then
 	response.write "<tr><td height=20>文件大小超过了限制 1024KB![ <a href=# onclick=history.go(-1)>重新上传</a> ]</td></tr>"
	response.end
 else
 randomize
 ranNum=int(90000*rnd)+10000
 filename="56770com"&year(now)&month(now)&day(now)&ranNum&"."&fileExt
 
 ok=filename
 filename="../pic/"&filename
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
  file.SaveAs Server.mappath(FileName)   ''保存文件
 	response.write "<script>parent.addproduct.cpic.value+='@@"&ok&"'</script>"
 iCount=iCount+1
 end if
 end if
 set file=nothing
next
set upload=nothing  ''删除此对象
response.write "<tr><td height=20>图片已经成功上传![ <a href=# onclick=history.go(-1)>继续上传</a> ]</td></tr>"
else%>       
<form name="form" method="post" action="?chuan=yes" enctype="multipart/form-data" >
<tr><td height="20">
  <input name="file" type="file" class="form" size="25">
  <input name="Submit" type="submit" class="button" value="上传">
      </td></tr></form></table>
<%end if
end if%>

⌨️ 快捷键说明

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