PDA

View Full Version : File name search



ecnarongi
08-06-2002, 05:41 PM
I need an ASP way of searching for file names in a directory on a NT server. All help is apperciated, Thanks.

ecnarongi
08-06-2002, 09:45 PM
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??

ecnarongi
08-06-2002, 10:19 PM
Sorry for the confusion I figured it out. :thumbsup: the path was all messed up.