Docly Developers
Function API only Updated 17 Oct 2026

drive.getFile(path)

Returns the content of a file the way it appears on a mapped Docly drive. Called as drive.getFile(...).

Parameters

pathstringrequired

Path relative to the site root, built from the Path that drive.getFiles returns (prefix it with the folder you listed).

Returns

The file content as a byte array. null when the path is null or no file exists at the path. Deleted files are not found. No access check is made.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
// Read one file found with drive.getFiles
let files = drive.getFiles("/Documents");
let bytes = drive.getFile("Documents/" + files[0].Path);

docly.downloadBytes(bytes, files[0].ExportName);