Docly Developers
Function API only Updated 17 Oct 2026

moveFolder(folderPath, destinationPath)

Moves a folder to a new location within your site.

See also Path traversal

Parameters

folderPathstringrequired

Path of the folder you want to move, from the site root (e.g. "myFolder" or "parent/child"). Separate levels with / — a backslash is not a path separator.

destinationPathstringrequired

Path of the folder to move it into, from the site root (e.g. "folder2/folder3").

Returns

A result object with Success and Message. Throws an error if the folder or the destination is not found, if the destination already has a folder with the same name, if you try to move a folder into itself, or if either folder only exists in the app the site is published from.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
// Move "folder1" from the root into "folder2/folder3"
docly.moveFolder("folder1", "folder2/folder3");

// Verify that the folder now exists at its new location
write(docly.folderExists("folder2/folder3/folder1"));