deleteFile(filePath) Last updated: 30. 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 successfully!");
}