ASP FileExists method
definition and usage
The FileExists method returns a Boolean value indicating whether the specified file exists. If it exists, it returns True, otherwise it returns False.
syntax:
FileSystemObject.FileExists(filename)
parameter | description |
---|---|
filename | required. It needs to check whether the file name exists. |
instance
<% dim fs set fs=Server.CreateObject("Scripting.FileSystemObject") if fs.FileExists("c:\asp\introduction.asp")=true then response.write("File c:\asp\introduction.asp exists!") else response.write("File c:\asp\introduction.asp does not exist!") end if set fs=nothing %>