Hey Peeps.
Could someone advise me on how I can find out whether a file exists on the server thru ASP? Thanks.
Printable View
Hey Peeps.
Could someone advise me on how I can find out whether a file exists on the server thru ASP? Thanks.
The following code will check if there is a file called "index.asp" in a certain folder (just change the folder name).
<%
Set fileIO = CreateObject("Scripting.FileSystemObject")
path=Server.Mappath("/the_folder_name")
Set Dir=fileIO.GetFolder(path)
Set FileCollect=Dir.Files
For Each item in FileCollect
if item.name="index.asp" then response.write "Yes"
Next
set fileIO=Nothing
%>