fileExists(filePath) Last updated: 29. Apr 2026

Check whether a file exists or not within the site.

See also: folderExists getFile

Parameters

Name Type Description
filePath string Aboslute path to file to check if exists.

Returns

True if the file exists otherwise false.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
if (docly.fileExists("folder/file1")) 
    write("The file exists!");