--- title: "Base64 encoding" slug: "core-base-64-encoder-resolver" updated: 2026-04-23T06:48:11Z published: 2026-04-23T06:48:11Z canonical: "docs.lobstersoftware.com/core-base-64-encoder-resolver" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Base64 encoding *See also:* [Base64 decoding](/v1/docs/en/core-base-64-decoder-resolver) > [!NOTE] > **Value resolver – Abstract** > > **Purpose:** Returns the base64-encoded `String` for a suitable *input value* ("Content", "Document", "File information", "File reference", `String`). > > > [!TIP] > > Tooltip > > > > - **Usage**: The content to be returned as a Base64 string must be provided as the *input value*. The following data types can be used for this: > > - `String` > > - "Content" (`Content`) > > - "Document" (`Document`) > > - "File information" (`FileInfo`) > > - "File reference" (`FileReference`) > > - **NOTE:** Internally, the *input value* is always converted into a "Content" (`Content`) object. If none of the data types mentioned here is available as an *input value*, the return value is "no value" (`$null`). ![images/download/attachments/153256181/image-2024-6-12_12-38-32-version-1-modificationdate-1718188711819-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-6-12_12-38-32-version-1-modificationdate-1718188711819-api-v2.png) The [Base64 encoding](/v1/docs/en/core-base-64-encoder-resolver) resolver returns the Base64-encoded `String` for a suitable *input value*. - A "Content” (`Content`) data object is expected as an input value, whereby an automatic type conversion is performed based on the following data types: - Text value (`String`) - "Document" (`Document`), see [Documents](/v1/docs/en/doc-document) - "File information" (`FileInfo`), see [File](/v1/docs/en/fre-file-vo) - "File reference" (`FileReferenz`), see [File reference](/v1/docs/en/core-file-reference-content-builder), [File manager](/v1/docs/en/ac-environment-filemanager) - For all other data types as *input value*, the return value is always "no value" (`$null`). > [!NOTE] > Background: Base64 coding > > The Base64 code is not *encoding* in the cryptographic sense. It is merely a mapping rule for converting binary data by which a sequence of bytes (groups of 8 bits) is transferred into a character set with 64 "readable" and common characters (`[A-Z][a-z][0-9]+/`). > > As 6 bits are required to distinguish 64 characters, a group of 4 Base64 codes (4 x 6bit = 24bit) each represents 3 *unencrypted* bytes or letters of an ACSII text. > > Example: Text: `ABC` → ASCII byte sequence: `{65, 66, 67}` > > → Bits grouped 8 at a time: `{01000001, 01000010, 01000011}` → Bits grouped 6 at a time: `{010000, 010100, 001001, 000011}` → Base64 value/code: `{16/Q, 20/U, 9/J, 3/D}` → Base64 code: `QUJD` > > **NOTE:** At the end of the return value, up to two actual-equal characters (=) can appear, which are not contained in the Base64 character set and are only used as fill characters if the 3 : 4 substitution scheme is not completely utilized due to the length of the *input value*. > > Example: Text `AB` → `{01000001, 01000010} → {010000, 010100, 001000, } → {16/Q, 20/U, 8/I, } → QUI=` ## Example A logo image file stored in the server file system via the **Lobster Data Platform/Orchestration** [File manager](/v1/docs/en/ac-environment-filemanager) is integrated into the *body* of an e-mail message in `HTML` format. The content of the small image file for the "logo" should not be referenced but provided directly as a payload for the `src` attribute of an `img` element via the Base64 format. The `HTML` code for the `img`element should be provided in advance in a variable with the name `image`, which can be accessed (several times if necessary) when compiling the e-mail body: `<img style="height:50px" src="data:<type>;charste:utf-8;base64,<base64data>" alt="<fileName>" />` - `<type>` represents the content type of the file (as a string, e.g. `image/png`). - `<base64data>` defines the Base64-encoded file content. - `<fileName>` defines the file name that appears as a placeholder if the file cannot be displayed. Configuration: | The screenshot on the right shows an [Execute with](/v1/docs/en/core-with-actor) event action that defines the file to be included in the **Object resolver** as a *temporary reference object* via a [File reference](/v1/docs/en/core-file-reference-content-builder) value resolver. This means that the "Content" (`Content`) of the file is available for the action block as a complex data object, whose detailed data we transfer to the HTML structure defined above for the `img` element using a [Concat strings](/v1/docs/en/core-concat-string-resolver) value resolver: - The first, static text component opens the *tag*, sets formats using the `style` attribute and then opens the text section for the `src` attribute with the keyword "data:", which signals that image data follows and not a *link*. - In the second text component, we access the `mediaType` property of the "Content" object, the value of which can be adopted directly to declare the format of the subsequent data. - The following static text component declares the *encoding* used (`utf-8`) and then introduces the base64 section for the file content. **IMPORTANT:** The keyword `base64` is followed by a comma as a separator and not a semicolon as before. - The following static text component leads to the `alt` attribute, which is assigned the value from the `name` property of the "Content" object, before another static text component concludes the attribute and the element. | ![images/download/attachments/153256181/image-2024-6-13_9-1-55-version-1-modificationdate-1718262114350-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-6-13_9-1-55-version-1-modificationdate-1718262114350-api-v2.png) | | --- | --- |