getEmbeddedFile(path, id) Last updated: 29. Apr 2026

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

See also: getEmbeddedTextFile getEmbeddedFileSize saveEmbeddedFile

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);
    
    
    // Return an embedded file in API function?
    // docly.downloadEmbedded(file, embeddedId, "filename.pdf");

}#