Function: ext.GetFile

Reads the file with the given name from the Extension’s data folder and returns its content as binary data. If a custom folder is set for the Extension and the file doesn’t exist there or if no custom folder is set, it looks for the file in the Modules data folder (e.g. ‘data/mod/demopanel’). Returns an empty byte buffer if the file doesn’t exist or is empty.

Syntax

{
	"method": "ext.GetFile",
	"params": {
		"filename": "...",
	},
	"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
}
AdvFuture<std::vector<uint8_t>> GetFile( AdvString filename );
public Task<byte[]> GetFileAsync(string filename, CancellationToken ct = default);
getFile(filename: string): Promise<string>;

Parameters

filename : string

Name of the requested file. Can be a path relative to the Extension’s data folder or custom folder (if set). Example: ’test.txt’ or ‘mypath\test.txt’

Result : data