已经被删除</b></a>;")
F_File.SaveToFile path&F_FileName
Response.Write("<a href=''upfso.asp?action=fso&path="&path&"''><b><font color=''#000080''>点击这里继续上传:"&path&F_FileName&"</font></b></a>")
ElseIf FileIsExists=True And mode=1 Then
Response.Write("<font color=''#000080''>文件已经存在,您选择了不覆盖</font></b>")
Else
F_File.SaveToFile path&F_FileName
Response.Write("<a href=''upfso.asp?action=fso&path="&path&"''><b><font color=''#000080''>点击这里继续上传:"&path&F_FileName&"</font></b></a>")
End If
End IF
Set F_File=Nothing
Set FileUP=Nothing
Else
Dim path,nn,mmode
nn=Trim(request("nn"))
mmode=Trim(request("mode"))
path=Replace(request("path"),"//","/")
If path="" Then path="../newup/"
Response.Write("<form enctype=""multipart/form-data"" method=""post"" action=""upfso.asp?yes=upload&path="&path&"&nn="&nn&"&mode="&mmode&""" class=""admin_fso_up"" onsubmit=""CheckForm()"" name=''form''><label>选择:<input name=""File"" type=""File"" size=""20""/></label><label> <input type=""Submit"" name=""Submit"" class=""submit"" value="" 上传 "" /></label></form>")
End IF
''效验名称
Function IsvalidFileName(File_Name)
IsvalidFileName = False
Dim re,reStr
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="[^_\.a-zA-Z\d]"
reStr=re.Replace(File_Name,"")
If File_Name = reStr Then IsvalidFileName=True
Set re=Nothing
End Function
%>
upload.asp // 上传类
复制代码 代码如下:
<%
Dim oUpFileStream
Class Upload_File
Dim Form,File,Err
Private Sub Class_Initialize
Err=-1
End Sub
Private Sub Class_Terminate
''Clear Variables & Objects
If Err < 0 Then
oUpFileStream.Close
Form.RemoveAll
File.RemoveAll
Set Form=Nothing
Set File=Nothing
Set oUpFileStream =Nothing
End If
End Sub
Public Sub GetDate(RetSize)
''Define Variables
Dim RequestBinDate,sStart,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo
Dim iFileSize,sFilePath,sFileType,sFormvalue,sFileName
Dim iFindStart,iFindEnd
Dim iFormStart,iFormEnd,sFormName
If Request.TotalBytes < 1 Then
Err=1
Exit Sub
End If
If RetSize > 0 Then
If Request.TotalBytes > RetSize Then
Err=2
Exit Sub
End If
End If
Set Form = Server.CreateObject("Scripting.Dictionary")
Form.CompareMode = 1
Set File = Server.CreateObject("Scripting.Dictionary")
File.CompareMode = 1
Set tStream = Server.CreateObject("Adodb.Strea