How do I list all files in a web folder when the page loads?
I am trying the following code, but I cannot determine the path (strPath) of the webpage.
I am trying the following code, but I cannot determine the path (strPath) of the webpage.
Code:
<head>
<script language = "vbscript">
public Sub RunScript()
Dim objFSO, objFldr
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFldr = objFSO.GetFolder(strPath)
For Each objFl in objFldr.Files
Response.Write objFl.Name
Next
Set objFSO = Nothing
Set objFldr = Nothing
End Sub
</script>
</head>
<body onload="vbscript:RunScript()">