ASP FileExists Method
Last Updated :
03 Mar, 2021
The FileExists Method in ASP is used for returning the Boolean value which indicates that whether a particular file exists or not. It returns true means the particular file exits or returns false if the particular file not exits.
Syntax:
FileSystemObject.FileExists(filename)
Parameter Values:
- filename: It specifies the name of the file which would be checked if exists or not.
Example: Below code demonstrates the FileExists Method.
ASP
<%
dim fs
set fs=Server.CreateObject( "Scripting.FileSystemObject" )
if fs.FileExists( "d:\hello\GFG.asp" ) then
response.write( "File d:\hello\GFG.asp exists!" )
else
response.write( "File d:\hello\GFG.asp does not exist!" )
end if
set fs=nothing
%>
|
Output:
File d:\hello\GFG.asp exists
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...