[This is preliminary documentation and subject to change]

## FileExists

The FileExists method checks the existence of a file. It returns -1 if the specified URL exists within a published directory. If the file does not exist, it returns 0. FileExists only checks the existence of files published on your site. Therefore, it takes a relative URL rather than an absolute URL.

###### Syntax

oTools.FileExists(URL)

###### Parameters

URL
  A string that specifies the relative URL of the file you are checking.

###### Example

The following example demonstrates using the FileExists property to create a link if a particular file is present.

--- Tools_FileExists.asp ---

    <%
    Set oTools = Server.CreateObject("MSWC.Tools")

    If oTools.FileExists("/win2000.gif") then
    %>
      <p>
      <a href="http://www.microsoft.com/windows2000/guide/professional/overview/">
      <img src="/win2000.gif">
      </a>
    <%
    End If
    %>

###### See Also

ProcessForm, Random

© 1997-2001 Microsoft Corporation. All rights reserved.