Function Updated 27 Oct 2026
getEmbeddedTextFile(path, id, [encoding])
Get the text content of an embedded file in a specific document.
Parameters
pathstringrequiredAbsolute path of Docly document to get embedded text file from.
idstringrequiredID of embedded file to get text content from.
encodingstringoptionalText encoding: UTF8 (default), UTF-8, UTF7, UTF32, Unicode, BigEndianUnicode, ASCII or Default. Not case sensitive. An unknown name throws error -901.
Returns
The content of the embedded file as a string. null when the document or the embedded file does not exist, or when the path or id is invalid (.., a backslash, or characters not allowed in a file name).
Example
Normal JavaScript, running in the browser or on the Docly™ server.
// Read a CSV file uploaded to the field "File" of a document
let path = "Imports/Prices";
let doc = docly.getFile(path);
let text = docly.getEmbeddedTextFile(path, doc.File, "UTF8");
for (let line of text.split("\n"))
write(line + "<br>");