getFileContent
Returns the contents of a stored file in a UTF-8 encoded array.
Syntax
function getFileContent(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 = getFileContent('Report_ddde85d9-ca38-42b8-b6b9-e5cc6bb4078c.pdf');