42 users online (0 members and 42 guests)  


  Results 1 to 7 of 7

Related

  1. search engine listing    Forum: Search Engine Optimization - SEO - Forum
    Replies: 2
  2. Replies: 17
  3. How do I add music to my Ebay listing??    Forum: HTML Forum
    Replies: 3
  4. Listing of Affiliate Sponsors who actually DO PAY    Forum: Affiliate Marketing and Reseller Programs
    Replies: 3
  1. #1
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    listing of all files in dir

    trying to get listing of files in dir
    this doesnt seem to work for some reason, script processes forever. havent really debugged, been lazy. why bother when there are so many experts here to help

    Set objFS = Server.CreateObject("Scripting.FileSystemObject")

    Set objFiles = objFS.GetFolder(Server.MapPath("\zerofc\babes")).Files
    For Each objFile In objFiles
    if not objFile.Name = "Snone.gif" then
    Response.Write objfile.Name & "<BR>"
    Response.Write "<a href='" & objFolder.Name & "/" & objFile.Name & ">" & objFile.Name & "</a>"
    end if
    Next
    set objFS = nothing
    set objFiles = nothing

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Shouldn't

    Code:
    Response.Write objfile.Name & "<BR>"
    Have an upppercase F?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    ASP isn't case sensitive.

    if someone has some other way of listing files in a directory, please help.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Sorry, PHP has spoiled me in that regard.

    Try this -

    Code:
    <%
    Sub ListDirectory(objFolder)
     Dim objFile
     Dim objSubFolder
    
     For Each objFile in objFolder.Files
       Response.Write("<A HREF=""" & objFile.Path & """>" & objFile.Name & "</A><BR>")
     Next
    
     For Each objSubFolder in objFolder.SubFolders
       ListDirectory objSubFolder
     Next
    End Sub
    
    Dim objFSO
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    
    Dim strCurrentFolder
    strCurrentFolder = "C:\Inetpub\wwwroot\test\"
    Dim objFolder
    Set objFolder = objFSO.GetFolder(strCurrentFolder)
    
    ListDirectory objFolder
    %>
    taken from -
    http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20025270.html

    There is also one for listing files and directories at that link.

    I find my favourite asp site is www.4guysfromrolla.com , try it, you might like it.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    thanks, will try it out

    www.4guysfromrolla.com is famous, i have it bookmarked too

  6. #6
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    i found out that calls to FSO will cause IIS to hang if Norton Anti-Virus (any version) is running in the background and has script-blocking enabled. I hope this helps anyone else who runs into this problem, i wasted hours trying to figure out the cause.

  7. #7
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    eek. Good call. Our intranet has norton 8|
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread