Results 1 to 3 of 3

Thread: files

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    I need to get the files in a folder (on the server) using ASP.

    Just the file names, something that would return me an array with the names of the files inside a certain folder on the server.
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Modify this to suit your needs...


    Code:
    <%@ Language=VBScript %>
    <html>
    
        <%
    	Set fileIO = CreateObject("Scripting.FileSystemObject")
        
    	path=Server.Mappath(".") 
        
    
    	
        Set Dir=fileIO.GetFolder(path)
        Set FileCollect=Dir.Files
        For Each item in FileCollect
      
        Response.Write("<A HREF='" & item.name & "'>" & item.name & "</A><BR>")
      
    	Next
    	set fileIO=Nothing
    %>
    
    </html>
    Mark
    -------------------

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Thanks .. :-)
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

Posting Permissions

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



Click Here to Expand Forum to Full Width