Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file list

Status
Not open for further replies.

cjkenworthy

Programmer
Sep 13, 2002
237
GB
I have a directory on my web server with lots of image files. The files in here change regularly.

I basically want to have an ASP page that generates a dynamic list of hyperlinks that point to each image file in the directory.

Any pointers?

 
in ASP :
Code:
<%
dim fs, folder, filesColl, curFile
set fs = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set folder = fso.GetFolder(&quot;C:\images&quot;)
Set filesColl = folder.Files
For Each curFile in filesColl
  response.Write (&quot;<A href=&quot;./images/&quot; & curFile.name & &quot;>&quot; & curFile.name & &quot;</A><BR/>&quot;)
Next
%>
Beware that GetFolder needs an unc path rather than an URL. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top