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

📄 upfile.asp

📁 实用的拍卖源码。适合个人建站学习使用。仅供学习参考
💻 ASP
字号:
<% 'OPTION EXPLICIT %>
<!--#include FILE="upload_5xsoft.inc"-->
<!--#include FILE="../inc/char.asp"-->
<!--#include FILE="conn.asp"-->
<html>
<head>
<title>附件上传---联系QQ:6439358,联系邮箱vqqq59r@163.com,网站www.vqqq.com,谢谢大家对我们系统的支持</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../images/main_style.css">
</head>
<body leftmargin="0" topmargin="0">

<%
dim upload,file,formName,formPath,iCount,FileName,rFileName,rFileName2
set upload=new upload_5xSoft ''建立上传对象

if filepath="" then   ''得到上传目录
 HtmEnd "请联系管理员设置的上传目录!"
 set upload=nothing
 response.end
else
 formPath=filepath
 ''在目录后加(/)
 if right(formPath,1)<>"/" then formPath=formPath&"/" 
end if

iCount=0
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
 FileName=File.FileName
if FileName="" then response.write "上传文件不能为空"
 rFileName=right(FileName,4)
 rFileName2=Ucase(rFileName)
if not (rFileName2=".GIF" or rFileName2=".JPG") then
	   response.write "<script language=javascript>alert('对不起,图片的上传格式只能为GIF和JPEG!请返回重新选择图片。');"
	   response.write "history.back(-1);</script>"
	   response.end
end if
	if File.FileSize>upsize then
	   response.write "<script language=javascript>alert('对不起,图片太大了,请重新选一张图片!');"
	   response.write "history.back(-1);</script>"
	   response.end
	end if
 FileName=replace(FileName,rFileName,"")
dim num1
Randomize '初始代随机数种子
num1=rnd() '产生随机数num1
num1=int(26*num1)+65 '修改num1的范围以使其是A-Z范围的Ascii码,以防表单名出错
dim uptime
uptime=now()
uptime=replace(uptime,":","")
uptime=replace(uptime," ","")
uptime=replace(uptime,"-","")

 FileName=uptime&chr(num1)&rFileName
  file.SaveAs Server.mappath(formPath&FileName)   ''保存文件
  'response.write "<table cellpadding=0 cellspacing=0 width=250 align=left><tr><td>"
  'response.write "<a href=http://www.vqqq.com"&formPath&FileName&">http://www.vqqq.com"&formPath&FileName&"</a><br>"
  'response.write "</td></tr></table>"
  iCount=iCount+1
 end if
 set file=nothing
next
set upload=nothing  ''删除此对象
%>
<font class=td>图片上传成功!</font>
</body>
</html>
<%
'on error resume next

dim comeurl
comeurl=request.servervariables("HTTP_REFERER")
comeurl=left(comeurl,instrrev(comeurl,"/"))

session("filep")=comeurl&formPath&FileName
%>

⌨️ 快捷键说明

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