Return to Snippet

Revision: 26434
at April 28, 2010 08:44 by wizard04


Initial Code
<%
function getListOfFiles(path)
	dim fs, folder, list(), ub
	set fs = CreateObject("Scripting.FileSystemObject")
	set folder = fs.GetFolder(path)
	ub = -1
	for each file in folder.Files
		ub = ub+1
		redim preserve list(ub)
		list(ub) = file.Name
	next
	getListOfFiles = list
end function

dim files : files = getListOfFiles(server.MapPath("/images"))
for each name in files
	response.Write(name&"<br>")
next
%>

Initial URL

                                

Initial Description

                                

Initial Title
List files in a directory

Initial Tags
file, ASP

Initial Language
ASP