Filesystem functions
Functions to link files and images from Docly to your web content.
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.
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.