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

📄 upfile.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
字号:
<!--#include file="../include/upfile_class.asp"-->
<%
Select Case Lcase(Request("action"))
	Case Lcase("SaveFile")
		SaveFile
	Case Else
		head
		upForm
		footer
End Select
Sub SaveFile
dim upfileObj,url,upPath
url=trim(Request("url"))
upPath=Server.MapPath("../skins/"&url)
set upFileObj=new upFile_class
upFileObj.AllowExt="jpg;gif;bmp"
upFileObj.GetData(3000*1024)
Select Case cint(upFileObj.isErr)
	Case 1
		response.write("<table height=""100%"" style=""margin:0px;padding:0px;font-size:12px;""><tr><td valign=""middle"">你没有上传数据呀! [<a href=# onClick='window.history.go(-1)'>返回重新上传</a>]</td></tr></table>")
		exit sub
	Case 2
		response.write("<table height=""100%"" style=""margin:0px;padding:0px;font-size:12px;""><tr><td valign=""middle"">您上传的数据超出我们的限制啦! [<a href=# onClick='window.history.go(-1)'>返回重新上传</a>]</td></tr></table>")
		exit sub
	Case 3
		response.write("<table height=""100%"" style=""margin:0px;padding:0px;font-size:12px;""><tr><td valign=""middle"">该类型文件不允许上传! [<a href=# onClick='window.history.go(-1)'>返回重新上传</a>]</td></tr></table>")
		exit sub
	case else
End Select
fileName=trim(upFileObj.form("fileName"))
if fileName="" then fileName=upFileObj.file("upfile").fileName
upFileObj.saveToFile "upfile",upPath&"\"&fileName
if upfileobj.isErr>0 then
	response.write("<table height=""100%"" style=""margin:0px;padding:0px;font-size:12px;""><tr><td valign=""middle"">该类型文件不允许上传! [<a href=# onClick='window.history.go(-1)'>返回重新上传</a>]</td></tr></table>")
else
	response.write("<table height=""100%"" style=""margin:0px;padding:0px;font-size:12px;""><tr><td valign=""middle"">上传成功啦! 保存在"&upPath&"\"&fileName&"[<a href=# onClick='window.history.go(-1)'>返回继续上传</a>]</td></tr></table>")
end if
End Sub
Sub head()%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../admin/images/admin.css" type="text/css" rel="stylesheet"></link>
<style>
form{margin:0px;}
</style></head><body>
<%
End Sub
Sub upForm()%>
<form action="?action=SaveFile&url=<%=Request("url")%>" method="post" enctype="multipart/form-data" name="form1">
  <input type="file" name="upfile" size="30">
  <input type="submit" name="Submit" value="上传">
  保存名: 
  <input name="fileName" type="text" size="15"> *如:a.gif。不填写,按原名保存
</form>
<%End Sub
Sub footer()%>
</body>
</html>
<%End Sub
'========================================================
'MaoSin CMS 1.1      Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com  http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>

⌨️ 快捷键说明

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