|
Display all files in a directory .
Here we show you a metod of displaying all the
files that are available in a directory , in this case the directory
is called images.
Code :
<%
Dim objFSO , objFolder , file
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("images/"))
For Each file in objFolder.SubFolders
%>
<a href="images/<%= file.Name %>"><%=
file.name %></a><br>
<%
Next
%>
<%
For Each file in objFolder.Files
%>
<a href="images/<%= file.name %>"><%=
file.name %></a><br>
<%
Next
Set objFolder = Nothing
Set objFSO = Nothing
%>
|