" & vbcrlf
end if
' Current folder
if rqF <> "" then
dim strCurFolder, strCurFolder2, strCurFolderIndent
if rqF <> "" then strCurFolderIndent = strFolderBCIndent & " "
strCurFolder2 = spltCurFolderPath(ubound(spltCurFolderPath))
if strFolderBCLink <> "" then strFolderBCLink = "/" & strFolderBCLink
if rqL = 0 then response.write strCurFolderIndent & " " & strCurFolder2 & " " & vbcrlf
end if
' Sub folders
dim strSubFolderIndent, strSubFolderGotoPath, strDoNotDisplay1, w
strSubFolderIndent = strCurFolderIndent & " "
for each item in folder.SubFolders
if rqF <> "" then strSubFolderGotoPath = rqF & "/" & item.name else strSubFolderGotoPath = item.name
for w = lbound(DontDisplayDirs) to ubound(DontDisplayDirs)
strDoNotDisplay1 = DoNotDisplay(DontDisplayDirs(w), strSubFolderGotoPath)
if not strDoNotDisplay1 then exit for
next
if strDoNotDisplay1 then
if rqL = 0 then
response.write strSubFolderIndent & " " & item.name & " " & vbcrlf
elseif rqL = 1 then
if RowColour = 0 then RowColour = 1 : RC = "odd" else RowColour = 0 : RC = "even"
response.write "
" & vbcrlf
end if
end if
next
' Files
dim strFilesIndent, strFilesReplace, strFilePath
strFilesIndent = strSubFolderIndent
for each item in folder.Files
if not DisplayFilesInListing(item.name, item.path) then
dim strFileType1, s, DDF
strFileType1 = mid(item.path, instrrev(item.path, ".") + 1, len(item.path) - instrrev(item.path, "."))
for s = 0 to ubound(OnlyFiletypes)
if lcase(OnlyFiletypes(s)) = lcase("." & strFileType1) then DDF = true
next
if DDF or OnlyFiletypes(0) = "" then
strFilesReplace = replace(item.name, "%", "%25")
strFilesReplace = replace(strFilesReplace, " ", "%20")
strFilePath = "http://" & request.ServerVariables("HTTP_HOST") & left(request.ServerVariables("URL"), instr(request.ServerVariables("URL"), filename) - 1)
if right(strFilePath, 1) = "/" then strFilePath = left(strFilePath, len(strFilePath) - 1)
if rqL = 0 then
response.write strFilesIndent & " " & item.name & " " & vbcrlf
elseif rqL = 1 then
if RowColour = 0 then RowColour = 1 : RC = "odd" else RowColour = 0 : RC = "even"
response.write "
" & vbcrlf
end if
end if
DDF = false
end if
next
if rqL = 1 then
response.write "" & vbcrlf &_
"
"
%>
<%
end if
' Cleanup
set folder = nothing
set fs = nothing
end sub
function GetFolderProperties(FilesCount, SubfolderCount, FileSize)
dim FilesCountOut, FilesCountOut1, SubfolderCountOut, FileSizeOut, item0, item1, item2, strSubFolderGotoPath, strDoNotDisplay1, w, a, t
for each item0 in FilesCount
for t = lbound(OnlyFiletypes) to ubound(OnlyFiletypes)
dim strFileType1, s, DDF
strFileType1 = mid(item0.path, instrrev(item0.path, ".") + 1,len(item0.path) - instrrev(item0.path, "."))
if lcase(OnlyFileTypes(t)) = lcase("." & strFileType1) or OnlyFiletypes(0) = "" then
if not DisplayFilesInListing(item0.name, item0.path) then
FilesCountOut1 = FilesCountOut1 + 1
FileSizeOut = FileSizeOut + item0.size
end if
end if
next
next
if FilesCountOut1 = 1 then FilesCountOut = FilesCountOut1 & " file"
if FilesCountOut1 > 1 then FilesCountOut = FilesCountOut1 & " files"
for each item1 in SubfolderCount
if request.querystring("f") <> "" then strSubFolderGotoPath = request.querystring("f") & "/" & item1.name else strSubFolderGotoPath = item1.name
for w = lbound(DontDisplayDirs) to ubound(DontDisplayDirs)
strDoNotDisplay1 = DoNotDisplay(DontDisplayDirs(w), strSubFolderGotoPath)
if not strDoNotDisplay1 then exit for
next
if strDoNotDisplay1 then SubfolderCountOut = SubfolderCountOut + 1
next
if SubfolderCountOut > 1 then
SubfolderCountOut = SubfolderCountOut & " directories"
elseif SubFolderCountOut = 1 then
SubfolderCountOut = SubfolderCountOut & " directory"
end if
if round(FileSizeOut, 0) = 0 then
FileSizeOut = ""
elseif len(round(FileSizeOut, 0)) >= 10 then
FileSizeOut = round(FileSizeOut / 1024 / 1024 / 1024, 2) & " GB"
elseif len(round(FileSizeOut, 0)) >= 7 then
FileSizeOut = round(FileSizeOut / 1024 / 1024, 2) & " MB"
elseif len(round(FileSizeOut, 0)) >= 4 then
FileSizeOut = round(FileSizeOut / 1024, 2) & " KB"
elseif len(round(FileSizeOut, 0)) >= 1 then
FileSizeOut = FileSizeOut & " bytes"
end if
if FilesCountOut <> "" then FilesCountOut = FilesCountOut & " totalling "
if FileSizeOut <> "" then FileSizeOut = FileSizeOut & ". "
if SubFolderCountOut = "" and FileSizeOut <> "" then FileSizeOut = left(FileSizeOut, len(FileSizeOut) - 1)
if SubFolderCountOut <> "" then SubFolderCountOut = SubFolderCountOut & "."
if FilesCountOut = "" and FileSizeOut = "" and SubfolderCountOut = "" then GetFolderProperties = "No files or directories."
if FilesCountOut <> "" or FileSizeOut <> "" or SubfolderCountOut <> "" then GetFolderProperties = FilesCountOut & FileSizeOut & SubfolderCountOut
end function
function GetFileSize(ItemSize,Short)
dim GetFileSize2
if len(ItemSize) = 0 then
GetFileSize2 = ""
elseif len(round(ItemSize, 0)) >= 10 then
GetFileSize2 = round(ItemSize / 1024 / 1024 / 1024, 2) & " GB total."
elseif len(round(ItemSize, 0)) >= 7 then
GetFileSize2 = round(ItemSize / 1024 / 1024, 2) & " MB total."
elseif len(round(ItemSize, 0)) >= 4 then
GetFileSize2 = round(ItemSize / 1024, 2) & " KB total."
elseif len(round(ItemSize, 0)) >= 1 then
GetFileSize2 = ItemSize & " bytes total."
end if
if Short = 1 then GetFileSize = replace(GetFileSize2, " total.", "") else GetFileSize = GetFileSize2
end function
function DisplayFilesInListing(Item, ItemPath)
dim arrFiles, h
arrFiles = array("dirlist1.gif", "dirlist2.gif", "dirlist3.gif", "dirlist4.gif", "dirlist5.gif", "dirlist6.gif", "dirlisttile1.gif", "dirlisttile2.gif", "dirlisttile3.gif", FramesetFilename, ToolbarFilename, "back.gif", "favorites.gif", "fileViewDetail.gif", "fileViewThumbnails.gif", "fileViewTree.gif","refresh.gif","blank.gif","sort-up.gif","sort-down.gif")
if item = filename and request.querystring("f") = "" then DisplayFilesInListing = true
for h = lbound(arrFiles) to ubound(arrFiles)
if ImagesPath <> "" then
if lcase(ItemPath) = server.mappath(ImagesPath & arrFiles(h)) then DisplayFilesInListing = true : exit for
elseif ImagesPath = "" and request.querystring("f") = "" then
if Item = arrFiles(h) then DisplayFilesInListing = true
end if
next
end function
function DoNotDisplay(DND1, DND2)
dim h
for h = 0 to ubound(DontDisplayDirs)
if left(DND1, 2) = "*/" then
if right(DND1, 1) = "*" then
dim DontDisplay1
DontDisplay1 = right(DND1, len(DND1) - 2)
DontDisplay1 = left(DontDisplay1, len(DontDisplay1) - 1)
if instr(lcase(DND2), lcase(DontDisplay1)) > 0 then
DoNotDisplay = false
exit for
else
DoNotDisplay = true
end if
else
dim DontDisplay2
DontDisplay2 = right(DND1, len(DND1) - 2)
if instr(lcase(DND2), lcase(DontDisplay2)) > 0 then
DoNotDisplay = false
exit for
else
DoNotDisplay = true
end if
end if
elseif instr(DND1,"*") > 0 then
if lcase(left(DND1, instr(DND1,"*") - 1)) <> lcase(left(DND2, instr(DND1,"*") - 1)) then
DoNotDisplay = true
else
DoNotDisplay = false
exit for
end if
else
if lcase(DND1) <> lcase(DND2) then
DoNotDisplay = true
else
DoNotDisplay = false
exit for
end if
end if
next
end function
%>
Handicap Stakes Results Thoroughbreds 2005
<% if request.querystring("l") = 1 then %>
<% end if %>
1 then response.write "listing" %>">
<%
dim rqF1
rqF1 = request.querystring("f")
' Test for Directory-traversal
dim DirTraversal, spltDirTraversal1, spltDirTraversal2, k, j
if trim(rqF1) = "/" then DirTraversal = true
if left(trim(rqF1),1) = "\" then DirTraversal = true
if left(trim(rqF1),2) = ".." then DirTraversal = true
if left(trim(rqF1),1) = "." then DirTraversal = true
if left(trim(rqF1),3) = "/.." then DirTraversal = true
if left(trim(rqF1),2) = "/." then DirTraversal = true
if left(trim(rqF1),4) = "/../" then DirTraversal = true
if left(trim(rqF1),3) = "/./" then DirTraversal = true
if left(trim(rqF1),3) = "../" then DirTraversal = true
if left(trim(rqF1),2) = "./" then DirTraversal = true
if left(trim(rqF1),3) = "\.." then DirTraversal = true
if left(trim(rqF1),2) = "\." then DirTraversal = true
if left(trim(rqF1),4) = "\..\" then DirTraversal = true
if left(trim(rqF1),3) = "\.\" then DirTraversal = true
if left(trim(rqF1),3) = "..\" then DirTraversal = true
if left(trim(rqF1),2) = ".\" then DirTraversal = true
if right(trim(rqF1),1) = "/" then DirTraversal = true
if right(trim(rqF1),1) = "\" then DirTraversal = true
if right(trim(rqF1),2) = ".." then DirTraversal = true
if right(trim(rqF1),1) = "." then DirTraversal = true
if right(trim(rqF1),3) = "/.." then DirTraversal = true
if right(trim(rqF1),2) = "/." then DirTraversal = true
if right(trim(rqF1),4) = "/../" then DirTraversal = true
if right(trim(rqF1),3) = "/./" then DirTraversal = true
if right(trim(rqF1),3) = "../" then DirTraversal = true
if right(trim(rqF1),2) = "./" then DirTraversal = true
if right(trim(rqF1),3) = "\.." then DirTraversal = true
if right(trim(rqF1),2) = "\." then DirTraversal = true
if right(trim(rqF1),4) = "\..\" then DirTraversal = true
if right(trim(rqF1),3) = "\.\" then DirTraversal = true
if right(trim(rqF1),3) = "..\" then DirTraversal = true
if right(trim(rqF1),2) = ".\" then DirTraversal = true
spltDirTraversal1 = split(rqF1, "/")
for k = 0 to ubound(spltDirTraversal1) - 1
if spltDirTraversal1(k) = ".." or spltDirTraversal1(k) = "." then
response.redirect(filename & "?k=1")
end if
next
spltDirTraversal2 = split(rqF1, "\")
for k = 0 to ubound(spltDirTraversal2) - 1
if spltDirTraversal2(k) = ".." or spltDirTraversal2(k) = "." then
response.redirect(filename & "?k=1")
end if
next
if request.querystring("fexists") <> "" then
response.write "
" & vbcrlf
else
if rqF1 <> "" then
dim DDD1, p
for p = lbound(DontDisplayDirs) to ubound(DontDisplayDirs)
DDD1 = DoNotDisplay(DontDisplayDirs(p), right(rqF1, len(rqF1) - 1))
if not DDD1 then exit for
next
if DDD1 then
ListFolderContents(server.mappath("." & rqF1))
else
response.redirect(filename & "?fexists=false")
end if
else
ListFolderContents(server.mappath("."))
end if
end if
%>