Tutorials References Exercises Sign Up Menu
Create Website Get Certified Pro

ASP FileExists Method

❮ Complete FileSystemObject Object Reference

The FileExists method returns a Boolean value that indicates whether a specified file exists. It returns True if the file exists and False if not.



Parameter Description
filename Required. The name of the file to check if exist


dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists("c:\asp\introduction.asp") then
  response.write("File c:\asp\introduction.asp exists!")
  response.write("File c:\asp\introduction.asp does not exist!")
end if
set fs=nothing

❮ Complete FileSystemObject Object Reference