Can you search for files on website and display li

Results 1 to 4 of 4

Thread: Can you search for files on website and display li

  1. #1
    Bill Connolly Guest

    Default Can you search for files on website and display li

    Thanks in advance for you helpful advice. <BR><BR>BACKGROUND<BR>I have an "games" page that displays the titles of video games from a database. Each title is a link to an "information" page that will display all facts in the database about the title picked and that part works fine. On that information page I would like to provide links to pictures, JPG files, that are screen prints of the games. This way when a viewer is browsing the information about a particular game they can click on a link and view the screenshots if they like. This information is not in my database but these files are all in a folder on the website. The screen prints file name is the title of the game with a number after it. Asteroids1.jpg, Asteroids2.jpg indicates that I have 2 different screen prints.<BR><BR>QUESTION<BR>Is it possible to write code on my "information" page that will search a folder on my website for file names containing the title of the video game selected +1 and create a link to that file? Then loop through for as many pictures as I have? There are cases where I have 1 picture, several pictures and no pictures.<BR><BR>Again thanks for your help.<BR><BR>Sincerely,<BR>Bill<BR>

  2. #2
    besharah Guest

    Default RE: Can you search for files on website and displa

    If you want to access the files on your website you can use the filesystemobject which is a component that comes with asp. It contains the usual objects that you would expect: file, drive, folder etc. I just finished doing exactly what you are trying to do. I had the filesystem object scan a particular directory and create a treeview of all the files and each "branch" on the treeview was a hyperlink which displayed the file. It was a pretty easy component to use and you should have no problem getting all the info you need off the net.<BR><BR>Good luck

  3. #3
    Join Date
    Dec 1969

    Default RE: Can you search for files on website and displa

    Just in case you can&#039t find them, here&#039s a snipped from the IIS documentation that iterates through the files in a given folder. <BR><BR>In your case you could modify it slightly to use fso.getFile(filespec) and skip the step of opening the folder.<BR><BR>Function ShowFolderList(folderspec)<BR> Dim fso, f, f1, fc, s<BR> Set fso = CreateObject("Scripting.FileSystemObject")<BR> Set f = fso.GetFolder(folderspec)<BR> Set fc = f.Files<BR> For Each f1 in fc<BR> s = s & <BR> s = s & "<BR>"<BR> Next<BR> ShowFolderList = s<BR>End Function<BR><BR>

  4. #4
    Bill Connolly Guest

    Default Thanks Stephan and Besharah! Will work on it toni

    It is friendly and helpful folks like you that make this message board so great. I really appreciate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts