GetEmbeddedFolderFile(folderPath, embeddedFilename) Last updated: 30. Jan 2025

Retrieves embedded file content from a folder's property file (.docly) by extracting and decoding the specified file data.

Parameters

Name Type Description
folderPath string The absolute path to the folder to read from the property file for.
embeddedFilename string The filename identifier of the embedded file to retrieve.
This identifier must match the reference defined in the property file.

Returns

Returns a byte array containing the decoded file content

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
// Example: Retrieving an embedded image from a folder

const folderPath = '/Test files/folder 1';
const folderProperties = docly.getFolderProps(folderPath);
if (folderProperties != null) {
    const bytes = docly.getEmbeddedFolderFile(folderPath, folderProperties.Image1);
    // bytes now contains the decoded file content as a byte[]
}

let json = JSON.stringify(folderProperties);
let pretty = JSON.format(json);
return pretty;

Output

The JS code above produces the output shown below:
{
  "SortOrder": "1",
  "DefaultContent": true,
  "Accept": "",
  "SpecifyCustomColumns": false,
  "CustomColumns": [],
  "CustomColumns_type": "CustomColumns",
  "HideFilenameColumn": false,
  "Expand": true,
  "Packages": [],
  "Packages_type": "Packages",
  "ROWID": "4533b73f-c3b6-5e77-b143-222e43d122fb",
  "OKCount": "0",
  "PassedCount": "0",
  "FailedCount": "0",
  "TotalCount": "0",
  "RemainCount": "0"
}