# How to convert a file to a Base64 string from an email trigger

**URL:** https://community.synatic.com/t/how-to-convert-a-file-to-a-base64-string-from-an-email-trigger/181
**Category:** Flows
**Tags:** flows, helper-functions
**Created:** [February 2, 2022, 11:07am UTC](https://community.synatic.com/t/how-to-convert-a-file-to-a-base64-string-from-an-email-trigger/181 "2022-02-02T11:07:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![navessa](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.synatic.com/navessa/32/58_2.png) [@navessa](https://community.synatic.com/u/navessa)
#### Post date: [February 2, 2022, 11:07am UTC](https://community.synatic.com/t/how-to-convert-a-file-to-a-base64-string-from-an-email-trigger/181/1 "2022-02-02T11:07:08Z")

</div>

The **Byte Group** step allows you to **convert a file to a Base64 string and a Base64 string to a file in bytes**.

Illustrated in the below image is an example of a flow with an email as a trigger source. In this example, a **file** is being **converted to a Base64 string**.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/c0760a8fd565ff59270ffe742fda2699760b77c2.png)

In the email trigger step, fill in the domain name of your email address **without** the “@” , tick the Process Attachments check box and type in the file type that you want to filter from your email as shown in the image below. Once that is done, click on “ **enable** ” and “ **attach** ” and then **save** to enable the trigger and to attach the file.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/49478764d63fc873ddc9f34224ea6ac44a784de5.png)

As per the image below, “ **Byte** ” has been selected from the dropdown list in the **Input Mode** and “ **Base64** ” has been selected from the dropdown list in **Output Mode**. This will reference the pdf file from the customized email address in the email trigger step as bytes and convert it to a Base64 string. If you want to give the Base64 string a field name, type a field name in the “To Field” field.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/ab0e7b9ba9ae4933c6c95382532476a50ad912c9.png)

Illustrated in the below image is the output containing the field name and the converted file as a Base64 string.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/780fd2092d45500dee2ec591221d56ab9fa046a7.png)

[Byte Buffers in Calculators](https://community.synatic.com/t/byte-buffers-in-calculators/60)
