Getting the list of files inside a directory by using FileSystemObject in ASPBy using FileSystemObject (FSO)we can list out all the files of a directory. Here we will be using server MapPath to map the virtual path to real path as used by file system object. After initiating the object we can instantiate the folder object. We will be using this folder object Files property to get all the files present within the folder.
Before this it is advisable to learn the FileSystemObject, Server MapPath to convert virtual path to real path before reading this.
In our example we have used the folder name my_folder which is inside the directory name t so the path of the folder is
Here is the code.
Dim objFSO, objFile, objFolder