Skip to content

GetBase64

Returns the content of the file as Base64 encoded.

1
myDocumentFiles.GetBase64(id: string):string

Parameters

string id
    The ID of the file.

Returns

The content of the file as a Base64 encoded string.

Remarks

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

This method throws an Error if the given file ID is not found.

Examples

Send a file to a service as Base64

1
2
3
4
5
6
$Rest.Create('https://api.example.com/')
    .Request('documents', {
        name : 'contract.pdf',
        content : $Files.GetBase64($Xml.Evaluate('ContractFile'))
    })
    .Post();