Directory Browsing with ASP

Results 1 to 3 of 3

Thread: Directory Browsing with ASP

  1. #1
    Join Date
    Dec 1969
    Posts
    57

    Default Directory Browsing with ASP

    I am currently in the process of building an intranet. I need to take a file structure, filled with word documents n&#039 things, and enable the users to browse through it from the intranet. I know that I can do it by making the directory browsable on my web server, but, lets be honest. That doesn&#039t look very good at all, does it? :) Essentially, I need something along the lines of the browser interface for IIS 4.0. Or even something explorer-esque. The main problem is, I have no idea where to start. Any ideas?<BR><BR>Thanks..<BR><BR>Christy

  2. #2
    Gerben van der Lei Guest

    Default RE: Directory Browsing with ASP

    You can use the server.mappath function to retrieve to the "real" directory from a virtual directory. For example:<BR>&#060;% Path = Server.Mappath("/images") &#037;&#062;<BR>could set the path variable = "c:inetpubwwwrootimages\"<BR>but that&#039s all I know<BR><BR>Hope it help&#039s a bit

  3. #3
    Ian Stallings Guest

    Default RE: Directory Browsing with ASP

    Yes you can use this:<BR><BR><BR>---------------------------------<BR>&#060;%<BR>&#039 Create an instance of the FileSystemObject<BR>Set MyFileObject=Server.CreateObject("Scripting.FileSy stemObject")<BR>&#039 Create Folder Object<BR>Set MyFolder=MyFileObject.GetFolder(Server.MapPath("sh ared"))<BR>&#039Loop trough the files in the folder<BR>FOR EACH item in MyFolder.Files<BR>&#037;&#062;<BR><BR>&#039and then you can loop them onto the page using:<BR><BR>&#060;%=item.name&#037;&#062;<BR><BR >&#060;%=item.size&#037;&#062;<BR><BR>&#060;%=item .type&#037;&#062;<BR><BR>&#060;%=item.DateCreated& #037;&#062;<BR><BR><BR>&#060;%Next&#037;&#062;<BR> <BR>------------------------------<BR><BR><BR>Of course this is a very simple example but can be customized.<BR>For instance you could then determine what type of file it<BR>is using the extension and assign a certain<BR>image to it. And you can make it appear<BR>however you want.<BR><BR>I hope this helps

Posting Permissions

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