Filesystem functions
Functions to link files and images from Docly to your web content.
getFiles(path, options)
Gets a list of files from folder / optionally recursively from subfolders.
See also: getFile, getFolder — see also List folders (for).
getFolder(path)
Returns information about a folder by given path.
See also: getFolderProps, getFiles, folderExists.
fileExists(filePath)
Check whether a file exists or not within the site.
See also: folderExists, getFile.
folderExists(path)
Check whether a folder exists or not within your site.
See also: fileExists, getFolder.
extractBase64Images(html)
This function extracts images encoded in base64 from an HTML string. It then converts these images to a more storage-efficient format by saving them separately as embedded files. The revised HTML string will reference these images using a Content ID (CID) mechanism, similar to how images are referenced in email attachments.
extractAndEmbedBase64Images(filePath, propertyFilter)
This function extracts images encoded in base64 from HTML properties of a document. It then converts these images to a more storage-efficient format by saving them as embedded files within the document. The revised HTML will reference these images using a Content ID (CID) mechanism, similar to how images are referenced in email attachments.
getEmbeddedFile(path, id)
Get bytes of an embedded file (image or file upload) in a specific document.
See also: getEmbeddedTextFile, getEmbeddedFileSize, saveEmbeddedFile.
getEmbeddedTextFile(path, id, encoding)
Get the text content of an embedded file in a specific document.
See also: getEmbeddedFile, saveEmbeddedFile.
getFile(filepath, metadata)
Gets information about a specific file.
See also: getFiles, getJson, fileExists — see also GetFiles and Folders examples.
logJson(filePath, data)
Creates a new JSON array file or adds a new item to the existing array in the file. This function works as a log, maintaining an array of events with automatic timestamping. If the log file path ends with '/', the current date (yyyyMMdd) will be automatically appended as the filename. The log automatically limits entries to prevent excessive file size.