Function API only Updated 23 Oct 2026
deleteFile(filePath)
Deletes a specified file. The call runs as the user who published the site, not as the visitor. Check the visitor's own rights with allowModify before you change anything on their behalf.
Parameters
filePathstringrequiredAbsolute path to the file you want to delete.
Returns
true when the file was deleted. false when the path is empty or no file exists at the path. A target that only exists in the app (publish template) the site runs from throws error 110: the app's files are shared by every site on it and can't be changed from a site.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
if (docly.deleteFile("Folder1/File1"))
{
write("File deleted successfully!");
}