ASP Script to display folder contents using ASP

ASP Script to Display folder contents.

Note : Keep all folders inside a folder Download
************************************
<%
set FileSysObj=CreateObject(“Scripting.FileSystemObject”)
    strFileAndPath = request.servervariables(“SCRIPT_NAME”)
    strPathOnly = Mid(strFileAndPath,1 ,InStrRev(strFileAndPath, “/”))
‘strPathOnly = Mid(strFileAndPath,1 ,InStrRev(strFileAndPath, “/download/”))
    strFullPath = server.mappath(strPathOnly)&”/download”
If Request.Querystring(“path”)<>“” Then
strFullPath = server.mappath(strPathOnly)&”/download/”&Request.Querystring(“path”)
Else
    strFullPath = server.mappath(strPathOnly)&”/download”
End If
    set fldr=FileSysObj.GetFolder(strFullPath)
response.write ”

    ‘response.write(“

Folders list

“)
    set FolderList = fldr.SubFolders
    For Each FolderIndex in FolderList
    Next
   ‘ response.write(“

Files list

“)
   response.write ”
———————-
    set FileList = fldr.Files
    For Each FileIndex in FileList
        ‘This bit excludes this page (and other asp files) from the list of links
        if Lcase(right(FileIndex.Name, 4)) <> “.asp” then
If Request.Querystring(“path”)<>“” Then
       Else
       
End If
 end if
    Next
%>
*********************

.