%
Dim strPath 'Path of directory to show
Dim strAbsPath 'User entered path
Dim objFSO 'FileSystemObject variable
Dim objFolder 'Folder variable
Dim objItem 'Variable used to loop through the contents of the folder
Dim DirName
' NOTE: As currently implemented, this needs to end with the /
strPath = "./"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If Request.QueryString("DIR") <> "" Then
Set strAbsPath = Request.QueryString("DIR")
Else
strAbsPath = Server.MapPath(strPath)
End If
Set objFolder = objFSO.GetFolder(strAbsPath)
%>
Contents of <%= strAbsPath %>
| File Name: | File Size (bytes): | Date Created: | File Type: |
| dir_list.asp?DIR=<%= DirName %>\><%= objItem.Name %> | <%= objItem.Size %> | <%= objItem.DateCreated %> | <%= objItem.Type %> |
| <%= objItem.Name %> | <%= objItem.Size %> | <%= objItem.DateCreated %> | <%= objItem.Type %> |