Skip to content

SetBase64

Updates the content of the file with the given ID.

1
myFiles.SetBase64(id: string, content: string):void

Parameters

string id
    The ID of the file to update.

string content
    The content of the file in Base64 encoded format.

Remarks

If the id parameter is not a GUID value, an Error is thrown.

If no file exists with the given ID, this method silently returns.

Examples

Replace the content of a file

1
2
3
4
var fileId = $Xml.Evaluate('ExportFile');
var text = $Files.FromBase64($Files.GetBase64(fileId)).toUpperCase();

$Files.SetBase64(fileId, $Files.ToBase64(text));