I need to get the files in a folder (on the server) using ASP.
Just the file names, something that would return me an array with the names of the files inside a certain folder on the server.
Printable View
I need to get the files in a folder (on the server) using ASP.
Just the file names, something that would return me an array with the names of the files inside a certain folder on the server.
Modify this to suit your needs...
Code:
<%@ Language=VBScript %>
<html>
<%
Set fileIO = CreateObject("Scripting.FileSystemObject")
path=Server.Mappath(".")
Set Dir=fileIO.GetFolder(path)
Set FileCollect=Dir.Files
For Each item in FileCollect
Response.Write("<A HREF='" & item.name & "'>" & item.name & "</A><BR>")
Next
set fileIO=Nothing
%>
</html>
Thanks .. :-)