getEmbeddedFile(path, id) Last updated: 30. May 2026

Get bytes of an embedded file (image or file upload) in a specific document.

See also: getEmbeddedTextFile getEmbeddedFileSize saveEmbeddedFile scaleImage Path traversal

Parameters

Name Type Description
path string

Absolute path of Docly document to get embedded file from.

id string

ID of embedded file to get.

Returns

Array of bytes, and NULL if file is not found.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    // Getting the embedded file from file name
    let p = docly.getFile("Test files/Example file.xlsx");
    let fileId = p.File;
    let bytes = docly.getEmbeddedFile(p.Url, fileId);
}#