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

📄 upload.asp

📁 5237 论坛.rar
💻 ASP
字号:
<!--#include File="Connections/connY.asp" -->
<!--#include File="Inc/Upload.inc"-->
<!--#include File="Inc/SetCss.asp"-->
<%
dim Upload,File,FormName,FormPath,FileName,FileExt
set Upload=new Upload_5xSoft ''建立上传对象

 FormPath=Upload.form("FilePath")
 if right(FormPath,1)<>"/" then FormPath=FormPath&"/" 

For Each FormName In Upload.File ''列出所有上传了的文件
 Set File=Upload.File(FormName)  ''生成一个文件对象
 If File.FileSize<50 Then
    Response.Redirect "Inc/Upload.asp?Error=1"
	Response.End
 End If
 	
 If File.FileSize>Cint(Forum_Limit)*1000 then
    Response.Redirect "Inc/Upload.asp?Error=2"
	Response.End
 End If

 FileExt=LCase(right(File.FileName,4))

 If FileExt<>".gif" And FileExt<>".jpg" And FileExt<>".bmp" And FileExt<>".doc" And FileExt<>".rm" And FileExt<>".txt" And FileExt<>".htm" And FileExt<>".zip" And FileExt<>".rar" And FileExt<>".swf" Then
    Response.Redirect "Inc/Upload.asp?Error=3"
	Response.End
 End If
 
 Filename=FormPath&Session("SUserID")&Year(now)&Month(now)&Day(now)&Hour(now)&Minute(now)&Second(now)&FileExt
 
 If File.FileSize>0 Then   ''如果 FileSize > 0 说明有文件数据
   
  File.SaveAs Server.Mappath(FileName)   ''保存文件
  Response.Redirect "Inc/Upload.asp?FileName="&File.FileName&"&FileSize="&File.FileSize&"&FilePath="&FormPath&"&FileExt="&FileExt&"&FileRealPath="&FileName
 End If
 Set File=nothing
 Next
 Set Upload=nothing  ''删除此对象
%>

⌨️ 快捷键说明

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