ng:base64EncodeResource

ng:base64EncodeResource

The built-in function, ng:base64EncodeResource converts the binary contents of a resource into base64. This can e.g. be used, if you want to insert any kind of data into an XML node, without substituting any characters, that are not allowed.

 

This function is related to: ng:base64ng:base64ToUTF8 and ng:base64EncodeFile.

 

This can e.g. be used, if you want to insert dynamic images directly in the contents of an email.

 

The function has this format: ng:base64EncodeResource(contentType, path), where:

 

contentType

Is the type of resource type in the Library.

 

path

The path to the resource within the selected resource type.

 

 

Example

Here is an example:

 

ng:base64EncodeResource('other','/Text/Myfile.txt')

 

This returns the base64 encoded data, that is found in the other resource, /Text/Myfile.txt

 

If the file resource e.g. contains the text:

 

InterForm

 

Then the function returns the equivalent base64 data stream:

 

SW50ZXJGb3Jt

    • Related Articles

    • ng:base64

      The built-in function, ng:base64 converts a string (text) into a base64 based string. This can e.g. be used, if you want to insert any kind of data into an XML node, without substituting any characters, that are not allowed. This function is related ...
    • ng:base64ToUTF8

      The built-in function, ng:base64ToUTF8 converts a base64 encoded string (text) into a UTF8 based string. This can e.g. be used, if you want to extract the original UTF-8 encoded text from a base64 encoded node found in an input XML input file. If the ...
    • ng:base64EncodeFile

      The built-in function, ng:base64EncodeFile converts the binary contents of a file into base64. This can e.g. be used, if you want to insert any kind of data into an XML node, without substituting any characters, that are not allowed. This function is ...
    • ng:spoolMapCond

      IMPORTANT: This function is only supported for spooled files loaded in the old format, Version 1, which is not recommended - it is not supported for spooled files loaded in version 2, which is better, default alternative to load spooled files in. ...
    • ng:databaseLookup

      You can execute an SQL lookup anywhere in InterFormNG2 (including in the designer) with the built-in Xpath function, ng:databaseLookup. An alternative to this function is the xent files, which can be used for lookup in the workflow only. Other ...