moveFolder(folderPath, destinationPath) Last updated: 13. May 2026

API only function

Moves a folder to a new location within your site.

See also: Path traversal

Parameters

Name Type Description
folderPath string The absolute path of the folder you want to move (e.g. "myFolder" or "parent\\child").
destinationPath string The absolute path of the destination folder where the folder will be placed (e.g. "folder2\\folder3").

Returns

An object containing the moved folder's information. Throws an error if the operation fails (e.g. folder not found or destination does not exist).

Example

Code example (JS)

JS is normal JavaScript either 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"));