Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post

    File name search

    I need an ASP way of searching for file names in a directory on a NT server. All help is apperciated, Thanks.
    I would rather be a lion for a day than a lamb that lives forever.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well OK, I am using FSO and I am not getting the results that I wanted. code:

    <%@ language=VBscript %>
    <% Response.Buffer = True %>
    <%
    Dim s
    Dim fs
    Dim ss
    Set fs = Server.CreateObject("Scripting.FileSystemObject")
    s = "The file 'test.html' exists "
    s = s & "in the directory " '& fs.GetSpecialFolder("\html\")
    s = s & ": <br>" & fs.FileExists("\html\") & "</b>"
    ss = Server.MapPath("\html\test.html")
    Response.write s & "<BR>"
    Response.write ss & "<BR>"
    Response.write fs.FileExists(ss)
    %>
    <% Response.End %>

    now I get false when I know that the file is there. Plus it kicks back the correct path. Can ne1 spot my error??
    I would rather be a lion for a day than a lamb that lives forever.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    Sorry for the confusion I figured it out. the path was all messed up.
    I would rather be a lion for a day than a lamb that lives forever.


  •  

    Posting Permissions

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