devxlogo

Dynamically Create a Web Page From an FTP Directory Listing

Dynamically Create a Web Page From an FTP Directory Listing

It’s possible to 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, 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 IIS 4.0 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")

devx-admin

Share the Post: