FTP Directory Listing

FTP Directory Listing

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

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(,".zip") thenresponse.write & "
" end ifNextEnd SubShowFolderList("e:inetpubftproot")


Share the Post: