Skip to content

GetString

Returns the file content as a string.

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

Parameters

string id
    The ID of the file.

string encoding
    The encoding of the file. Optional. The default is 65001 (UTF-8).

Returns

The file content as a string.

Remarks

This function is used to retrieve text file contents. If the file is binary, consider using Files.GetBase64 to avoid corrupting the file content.

Usage:

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

See Also