[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_FileExist
Back to ASP FAQ Main Page.
How to check if a file exists
This example will show you how to check if a file exists or not in ASP.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_FileExist
Back to ASP FAQ Main Page.
How to check if a file exists
This example will show you how to check if a file exists or not in ASP.
<%
'Check if a textfile exists example
'(c) 2001 Programmers Heaven
'http://www.programmersheaven.com
dim fso
'Create a FileSystemObject
set fso = Server.CreateObject("Scripting.FileSystemObject")
'Does the file exists?
If fso.FileExists("c:\autoexec.bat")=true Then
response.write "The file exists!"
else
response.write "The file does not exist!"
end if
'Release the object
set fso=nothing
%>
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
