devxlogo

FTP Directory Listing

FTP Directory Listing

Question:
How can I dynamically create a web page from an FTP directory listing of files with a particular extension?

Answer:
While there are sophisticated components (.DLLs) that you could add in, you could also use the FileSystemObject and do a little filtering in the ASP script. Here’s one approach, that builds on the sample code found in the IIS4 online help:

Sub ShowFolderList(folderspec)Dim fs, f, f1, fc, sSet fs = Server.CreateObject("Scripting.FileSystemObject")Set f = fs.GetFolder(folderspec)Set fc = f.FilesFor Each f1 in fcIf instr(f1.name,".zip") thenresponse.write f1.name & "
" end ifNextEnd SubShowFolderList("e:inetpubftproot")
See also  How College Students Can Shape the Future of Tech Responsibility
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist