DIM UPFILE_5XSOFT_STREAM
Class upload_5xSoft dim Form, File, Version Private Sub Class_Initialize dim iStart, iFileNameStart, iFileNameEnd, iEnd, vbEnter, iFormStart, iFormEnd, theFiledim strDiv, mFormName, mFormValue, mFileName, mFileSize, mFilePath, iDivLen, mStrVersion = "» ¯¾³ ± à³Ì½çHTTPÉÏ' «³ÌÐò Version 1.0" if Request.TotalBytes <1 then Exit Subset Form = CreateObject ( "Scripting.Dictionary") set File = CreateObject ( "Scripting.Dictionary") set upfile_5xSoft_Stream = CreateObject ( "Adodb.Stream") upfile_5xSoft_Stream.mode = 3UPFILE_5XSOFT_STREAM.TYPE = 1UPFILE_5XSOFT_STREAM.OpenupFile_5xsoft_Stream.Write Request.BinaryRead (Request.Totalbytes)
vbEnter = Chr (13) & Chr (10) iDivLen = inString (1, vbEnter) 1strDiv = subString (1, iDivLen) iFormStart = iDivLeniFormEnd = inString (iformStart, strDiv) -1while iFormStart
IFormStart = iformend idivlen iformend = Instring (iformstart, strdiv) -1wendend Sub
Private Function subString (theStart, theLen) dim i, c, stemp upfile_5xSoft_Stream.Position = theStart-1 stemp = "" for i = 1 to theLen if upfile_5xSoft_Stream.EOS then Exit for c = ascB (upfile_5xSoft_Stream.Read (1)) If c> 127 Then if upfile_5xSoft_Stream.EOS then Exit for stemp = stemp & Chr (AscW (ChrB (AscB (upfile_5xSoft_Stream.Read (1))) & ChrB (c))) i = i 1 else stemp = stemp & Chr (c) End If Next subString = stempEnd functionPrivate Function inString (theStart, varStr) dim i, j, bt, theLen, str InString = 0 Str = toByte (varStr) theLen = LenB (Str) for i = theStart to upfile_5xSoft_Stream.Size-theLen if i> upfile_5xSoft_Stream .size then exit Function upfile_5xSoft_Stream.Position = i-1 if AscB (upfile_5xSoft_Stream.Read (1)) = AscB (midB (Str, 1)) then InString = i for j = 2 to theLen if upfile_5xSoft_Stream.EOS then inString = 0 EXIT for END IF ASCB (Upfile_5xsoft_stream.read (1)) <> ASCB (MIDB (Str, J, 1)) THEN INSTRING = 0 exit for end if Next if Instring <> 0 THEN EXIT FUNCTION END IF NEXTEND FUNCTION
Private Sub Class_Terminate form.RemoveAll file.RemoveAll set form = nothing set file = nothing upfile_5xSoft_Stream.close set upfile_5xSoft_Stream = nothingEnd Sub Private function GetFilePath (FullPath) If FullPath <> "" Then GetFilePath = left (FullPath, InStrRev (FullPath, "/ ")) Else GetFilePath =" "End If End function Private function GetFileName (FullPath) If FullPath <>" "Then GetFileName = mid (FullPath, InStrRev (FullPath," / ") 1) Else GetFileName =" "End If End FunctionPrivate Function Tobyte (STR) DIM I, ICODE, C, ILOW, IHIGH TOBYTE = "" for i = 1 to Len (STR) C = MID (STR, I, 1) ICODE = ASC (C) IF ICODE <0 THEN ICODE = ICODE 65535 if iF icode> 255 Then iLow = Left (HEX (ASC (C)), 2) ihigh = Right (HEX (ASC (C)), 2) Tobyte = Tobyte & Chrb ("& H" & ilow) & Chrb ("& H" & ihigh) else Tobyte = Tobyte & ChRB (ASCB (c)) end if next end functionend Class