ftos.files.getByteArray
IMPORTANT!
Starting with v24.3.0, this is renamed from getFileContent to ftos.files.getByteArray.
Starting with v24.3.0, this is renamed from getFileContent to ftos.files.getByteArray.
Returns the contents of a stored file in a UTF-8 encoded array.
This is a business logic method for business service components.
Syntax
function ftos.files.getByteArray(fileName: string): number[]
| Parameter | Description |
|---|---|
fileName
|
Unique internal ID of the file (real name). |
Return Value
Returns an array that contains the each character in the file encoded using the UTF-8 standard.
For example, a file containing the following text:
abcÖ
will be converted to the following array:
[97, 98, 99, 195, 150]
Examples
In this example, we store the UTF-8 encoded contents of the Report_ddde85d9-ca38-42b8-b6b9-e5cc6bb4078c.pdf file in a variable called contents.
var contents = ftos.files.getByteArray('Report_ddde85d9-ca38-42b8-b6b9-e5cc6bb4078c.pdf');