Skip to content

GetString

Returns file content as string.

1
myFiles.GetString(id: string, encoding: string):string

Parameters

string id
    Id of file

string encoding
    Encoding of file. Optional. Default is 65001 (UTF-8)

Remarks

This function is used to retrieve text file contents, if file is binary you should consider to use Files.GetBase64 otherwise file content would be corrupted.

Example

1
2
3
4
5
Usage
files.forEach(function(file) {
    var fileContent = $Files.GetString(file.Id);
    // do sth with the file content
});