deleteFile(filePath) Last updated: 13. May 2026

API only function

Deletes a specified file.

See also: deleteFolder fileExists Path traversal

Parameters

Name Type Description
filePath string Absolute path to the file you want to delete.

Returns

Boolean, true if deleted otherwise false.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
if (docly.deleteFile("Folder1/File1"))
{
    write("File deleted successful!");
}