Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP FileExists Method

ASP FileExists Method


FileSystemObject Reference Complete FileSystemObject object reference manual


The FileExists method returns a Boolean value indicating whether the specified file exists. It returns True if it exists, otherwise False.

Syntax

FileSystemObject.FileExists(filename)

Parameters Description
filename Required. The name of the file to check for existence.

Example

<%

dim fs

set fs=Server.CreateObject("Scripting.FileSystemObject")

if fs.FileExists("c:\asp\introduction.asp") 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

%>


FileSystemObject Reference Complete FileSystemObject object reference manual