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

📄 fileupload.asp

📁 个人网站系统,本人基于第三方源码进行更改!
💻 ASP
字号:
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<!--#Include file="Common/Upload.inc"-->
<%
'┌─  风云ASP在线  ────────────────────────┐
'│                                                                 │
'│  作者:赵振波.	http://www.fyasp.com	    				    │
'│                                                                 │
'│   Q Q:176189168  										   	    │
'│                                                                 │
'│ Email:fy96@163.com                                             │
'│                                                                 │
'│ 程序定做,系统开发,网站制作,提供高质量的网络产品、技术和服务!│
'│                                                                 │
'│【版权声明】                                                     │
'│                                                                 │
'│     本程序版权归坐看风云所有,未经授权擅自修改、复制或散布本程序│
'│                                                                 │
'│的部分或全部,将承受严厉的民事和刑事处罚,对已知的违反者将给予法 │
'│                                                                 │
'│律范围内的全面制裁。对非法使用此程序所造成的一切后果本人概不负责!│
'│                                                                 │
'└───────────────────  http://www.fyasp.com ──┘
%>
<%if IsTimeOut(Session("strAccount"),Session("strPassWord")) then Response.Redirect "index.asp"%>
<html>
<head>
<title><% = strSiteName%> - 网站后台管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Common/Site.css" type="text/css">
</head>

<body topmargin="5" leftmargin="5">
<%
dim upload,file,formName,intCot,intFileCot
dim strFileExt,strCurrentFolder,strFileName,strHeadFileName,strLastFileName
dim intFileSize

set Upload = new upload_5xSoft	'建立上传对象

if upload.Form("FilePath") = "" then
	Response.Write "对不起,你没有指定要上传的目录!<br><br><a href=""javascript:history.back();"">返回</a>"
	set upload = nothing
else
	strCurrentFolder = upload.Form("FilePath")
	if Right(strCurrentFolder,1) <> "/" then
		strCurrentFolder = strCurrentFolder &"/"
	end if
end if

intCot = 0
intFileCot = 0
for each FormName in Upload.file    	'列出所有上传了的文件
	set File = Upload.file(FormName)	'生成一个文件对象
	if File.FileSize > 0 then		    '如果 FileSize > 0 说明有文件数据
		strFileExt = Right(File.FileName,3)
		if UCase(strFileExt) = "GIF" Or UCase(strFileExt) = "JPG" then
			intFileCot = intFileCot + 1
			strFileName = file.fileName
			strHeadFileName = intUserKey & FormatTime(now(),7)
			strFileName = strHeadFileName &"."& strFileExt
			File.SaveAs Server.MapPath(strCurrentFolder & strFileName)
		else
			intCot = intCot + 1
		end if
	end if
	set File = nothing
next
Response.Write "<br><br>照片上传成功!<br><br>"
if UCase(Upload.Form("Oper")) = "ADDPHOTO" then
	Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName.value = '"& strFileName &"'</script>"
end if
if UCase(Upload.Form("Oper")) = "ADDPHOTO1" then
	Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName1.value = '"& strFileName &"'</script>"
end if
if UCase(Upload.Form("Oper")) = "ADDPHOTO2" then
	Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName2.value = '"& strFileName &"'</script>"
end if
set Upload = nothing	'删除此对象
%>
</body>
</html>

⌨️ 快捷键说明

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