% Option Explicit Dim action,ZIP Dim a,b,c,i,item,j Dim arr,tstr Dim gblPassword gblPassword = "railroad1" 'your password here Dim gblSiteName,gblSiteCode gblSiteName = Request.ServerVariables("SERVER_NAME") 'Your site name here gblSiteCode = "" Dim gblNow gblNow = Now Dim gblFace,gblColor gblFace = """Arial, Helvetica, sans-serif""" gblColor = """#000066""" Dim gblTitle,gblPageText gblTitle = "houseviewonline.com " gblPageText = Null Dim gblScriptName gblScriptName = Request.ServerVariables("Script_Name") gblScriptName = Mid(gblScriptName,InstrRev(gblScriptName,"/") + 1) Dim gblRoot gblRoot = Replace(Request.ServerVariables("Script_Name"),"/" & gblScriptName,"") Dim gblRed gblRed = """#FF0000""" Dim gblReverse gblReverse = """#E0E0E0""" '----------- 'subprograms '----------- '-- 'StartHTML Sub StartHTML %>
| SIZE=3 FACE=<%=gblFace%>><%=gblSiteName%> |
| > SIZE=4 COLOR="#FFFFFF"> <%=gblTitle%> |
| SIZE=2><%=gblPageText%> |
Sorry." & VBCRLF End If EndHTML End If End Function 'Authorize '-- ' Condensation Function Condensation(s) a = 0 For i = 1 to len(s) a = (ASC(mid(s,i,1)) + a*2) Mod 77411 Next 'i Condensation = Right("00000" & Cstr(a),5) & Right("00000" & Cstr((len(s)*23)+25433),5) End Function 'Condensation(s) '-- ' DetailPage Sub DetailPage Dim chars,fstr,hw,height,width Dim IsTextFile,pathname Dim fsize,fdatecreated,fdatelastmodified pathname = fsDir & fn If right(pathname,1) = "\" Then pathname = Left(pathname,len(pathname)-1) ' create if you gotta If fso.FileExists(pathname) Then Else Select Case UCase(Request.QueryString("T")) Case "D" 'create document Set f = fso.CreateTextFile(pathname) f.Close Set f= Nothing Case "F" 'create folder Set f = fso.CreateFolder(pathname) pathname = pathname & "\" response.redirect gblScriptName & "?d=" & URLSpace(pathname) End Select End If StartHTML response.write "" & VBCRLF response.write "AnyPortal " & gblTitle & " requires Microsoft NT/Internet Information Server (IIS) 4.0 or greater." & VBCRLF response.write "
" & pathname & "
" & VBCRLF
response.write "" & webbase & fn & "
" & VBCRLF
If fso.FileExists(pathname) Then
' fetch NT's file information
Set f = fso.GetFile(pathname)
fsize = f.size
fdatecreated = f.datecreated
fdatelastmodified = f.datelastmodified
response.write "
" & VBCRLF response.write " file size: " & FormatNumber(fsize,0) & " characters" & VBCRLF response.write " file created: " & FormatDateTime(fdatecreated,1) & " " & FormatDateTime(fdatecreated,3) & VBCRLF response.write "last modified: " & FormatDateTime(fdatelastmodified,1) & " " & FormatDateTime(fdatelastmodified,3) & VBCRLF response.write "" & VBCRLF Set f = Nothing End If response.write " <% EndHTML End Sub 'DetailPage '-- ' DisplayCode Sub DisplayCode Dim fn,fso,f Dim code,tstr Dim a,arr,i fn = Request.QueryString("c") response.write "
| " & VBCRLF response.write " " & fn & " |
Cannot access " & fn & "" & VBCRLF End If response.write "
| ><%=chr(199)%> | SIZE=1><%=UCASE(fso.GetParentfolderName(fsDir) & "\")%> | ||
SIZE=4>Additional Folders |
|||
| COLOR=<%=gblRed%> SIZE=1>FOLDER NAME | |||
SIZE=4><%=fsDir%> |
|||
| COLOR=<%=gblRed%> SIZE=1>DOCUMENT NAME | COLOR=<%=gblRed%> SIZE=1>LAST UPDATE | COLOR=<%=gblRed%> SIZE=1>FILE SIZE | |
| VALIGN=""TOP""> | >
Your browser: |
<% EndHTML End Sub 'UploadPage '-- ' URLspace Function URLSpace(s) URLSpace = replace(replace(s,"+","%2B")," ","+") End Function 'URLSpace '---- 'MAIN '---- Dim f,fso,filelist,fn,upl Dim TextObject,fhandle,lsplit Dim fsDir,baseDir,webbase Dim fsRoot,webRoot Dim pathname Dim parent Dim toplevel gblTitle = "houseviewonline.com File Manager" 'get password If NOT Authorize Then 'function will output HTML for password Else 'initialization Set fso = CreateObject("Scripting.FileSystemObject") 'dynamically find out where the documents and web pages are located fsDir = replace(LCase(Request.QueryString("d")),"/../","/") If fsDir = "" Then fsDir = Request.Form("fsDir") fsRoot = LCase(Replace(Server.MapPath(gblScriptName),"\" & gblScriptName,"") & "\") If Instr(fsdir,fsroot) <> 1 Then fsDir = fsRoot If Lcase(fsDir) = Lcase(fsRoot) Then toplevel = TRUE basedir = Replace(Mid(fsDir,len(fsRoot),250),"\","/") webRoot = "http://" & Request.ServerVariables("SERVER_NAME") & Replace(Request.ServerVariables("SCRIPT_NAME"),"/" & gblScriptName,"") webbase = replace(webroot & basedir," ","%20") 'process a GET/POST request If Request.QueryString("u") = "D" Then Action = "UPLOAD" Else Action = Request.Form("POSTACTION") pathname = Request.Form("PATHNAME") End If Select Case UCase(Action) Case "UPLOAD" Set upl = Server.CreateObject("aspSmartUpload.SmartUpload") upl.AllowedFilesList = "jpg,gif,asp,html,htm,bmp,txt,inc,log,tiff,zip" upl.DeniedFilesList = "exe,bat,asp" upl.MaxFileSize = 3000000 upl.TotalMaxFileSize = 3000000 upl.Upload upl.Save fsdir & tstr Case "SAVE" Select Case UCase(Right(pathname,4)) Case ".TXT",".ASA",".ASP",".HTM","HTML",".CFM","PHP3" If Instr(pathname,fsroot) = 1 Then Set f = fso.CreateTextFile(pathname) f.write Request.Form("FILEDATA") f.close End If End Select Case "DELETE" 'either document or folder If Request.Form("OK") = "on" Then parent = Request.Form("Parent") If Instr(pathname,fsroot) = 1 Then fso.DeleteFolder Left(pathname,Len(pathname)-1),TRUE response.redirect gblScriptName & "?d=" & URLSpace(parent) End If End If If Request.Form("DELETEOK") = "on" Then If Instr(pathname,fsroot) = 1 Then If fso.FileExists(Request.Form("PathName")) Then Set f = fso.GetFile(Request.Form("PathName")) f.delete End If End If End If End Select If Action <> "" Then tstr = gblScriptName & "?d=" If NOT toplevel Then tstr = tstr & URLSpace(fsDir) response.redirect tstr End If 'check for mode... navigate, code display, upload, or detail? fn = LCase(Request.QueryString("f")) If fn = "" Then If Request.QueryString("u") = "Y" Then gblTitle = gblTitle & " (Upload Page)" gblPageText = "Use this page to upload a single document to this web site." UploadPage Else If Request.QueryString("c") = "" Then gblPageText = "Use this page to add, delete or revise documents on this web site." StartHTML Navigate EndHTML Else DisplayCode End If End If Else gblTitle = gblTitle & " (Detail Page)" gblPageText = "Use this page to view, modify or delete a single document on this web site." DetailPage End If End If %>