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

📄 upfile_link.asp

📁 在线招生报名系统 2009 (内附说明)
💻 ASP
字号:
<!--#include file="upload.asp"-->
<!--#include file="Function.asp"-->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<style type="text/css">
<!--
.font_cl {
	font-size: 12px;
	line-height: 1.5em;
	color: #000000;
	text-decoration: none;
}
-->
</style>
<%
maxFileSize = 1500
upFileType = "gif,jpg,swf,png"

set upload = new upload_file
uploadType = upload.Form("type")
select case uploadType
case "photo"    ''形象照片
	  savePath = "UploadPhotoPic/"
case "ad"	  ''广告
     savePath = "UploadAdPic/"
end select

for each formName in upload.file
	set file = upload.file(formName)
	if file.filesize < 100 then
		AlertBack "请选择要上传的文件!"
	end if
	if file.filesize > (maxFileSize*1024) then
		AlertBack "文件大小超过了限制,最大只能上传" & CStr(maxFileSize) & "K的文件!"
	end if

	fileExt = LCase(Right(file.filename, 3))
	fileExts = split(upFileType, ",")
	isValidFile = false
	for i=0 to ubound(fileExts)
		if fileExt = trim(fileExts(i)) then
			isValidFile = true
			exit for
		end if
	next
	
	if not isValidFile then AlertBack "这种文件类型不允许上传!"
	
	fileName = savePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&LCase(Right(file.filename, 4))
	file.SaveToFile Server.mappath(fileName)
	'response.write uploadType
	'response.end
	if uploadType = "photo" then
	
		strJS = "<body  bgcolor='#ECF5FF'><table align=center><tr><td class='font_cl' align=center>形象图片上传成功!</td></tr></table></body>"
	
	end if
	Response.Write strJS
    set file=nothing
    next
    set upload=nothing
%>

⌨️ 快捷键说明

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