# FAQ: Convert a blob key to base64 string for import?

**URL:** <https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358>\
**Category:** Integrator.io\
**Tags:** amazon-s3, ftp, import\
**Created:** [September 14, 2023, 7:28pm UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358 "2023-09-14T19:28:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathyanaqueeman](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/kathyanaqueeman/32/9122_2.png) [@kathyanaqueeman](https://connective.celigo.com/u/kathyanaqueeman)\
**Post date:** [September 14, 2023, 7:28pm UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/1 "2023-09-14T19:28:01Z")

</div>

There is currently no way to convert a blob key to base64 in integrator.io natively. However, you can use an Amazon S3 bucket in conjunction with an AWS Lambda function as a workaround. This requires two flows, not because the flows are complex, but because integrator.io runs so quickly that Amazon S3 won’t have time to convert the blob before integrator.io pulls the new file. You’ll need:

- [Amazon S3 account](https://aws.amazon.com/s3/)
- [Amazon S3 connection](https://docs.celigo.com/hc/en-us/articles/360038373912-Set-up-a-connection-to-Amazon-S3)
- [Lambda function with Amazon S3](https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html) (ext link) 
- An FTP account with your file
- [an FTP connection](https://docs.celigo.com/hc/en-us/articles/360045263152-Set-up-an-FTP-connection-)

**Flow 1: Transfer file from FTP to Amazon S3**

1. First, [create an FTP export](https://docs.celigo.com/hc/en-us/articles/360045238292-Export-files-from-an-FTP-server). 
  1. Do not parse your file. In this example, the exported file is a PNG. 

2. Import (transfer) your file to Amazon S3. 
  1. Do not generate a file from your record. 
  2. Set the [**Blob key path** field in the **Advanced** settings to **blobKey**](https://docs.celigo.com/hc/en-us/articles/360052055191-Upload-a-file-or-record-as-multipart-form-data#h_01FMQK6QM3KEJ8NMBHGM3PW2WC).

 ![5301043caa20740200000001-58fa1bd4cf9f4606ab9f7546132fd14f.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/6/6e3dbd05e6b5cc207e7d50b1b3bef0ed203e6cc1.png)

_Transfer file to Amazon S3_

In this example, the Amazon S3 file key (file name) is a handlebar expression that replaces the S3 file key (file name) with the generated blob key. For example, if your blob key is **234k**. The S3 file key (name) becomes **234k.png**.

**Create an AWS Lambda function that is invoked from uploads into Amazon S3 storage**

In AWS, use the Lambda feature to create a function that converts the blob key to base64. The function needs to be triggered by an S3 upload. To configure this, [use an Amazon S3 trigger to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html).

 ![5301043caa20740200000001-12ddb94c8f1947b88c7ecdfdd44ab035.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/d/d845941f962a7c2fbd01802e054ed81de2793efd.png)

_Function overview_

 ![5301043caa20740200000001-1c81fc79a687418091634d7885e396fb.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/c/cd0d92f287d150c20462af411a3996ee2100a09d.png)

_Trigger configuration_

**Tips** :

- Use a separate bucket for function outputs.
- Customize the trigger by setting the suffix to the file type you’re uploading in the first flow. In this case, the file ends with .png. So you can set the suffix to png. 

**Warning** : The code below is an example of converting the file. It has not been validated or endorsed by Celigo. Use this at your own risk.

```python
import boto3
import base64
import ison

def lambda_handler (event, context):
s3_bucket = event ['Records '][0]['s3']['bucket ']['name']
s3_key = event['Records '][0]['s3']['object]['key']

s3 = boto3.client('s3')

response = s3.get_object (Bucket=s3_bucket, Key=s3_key)
file_content = response ['Body'].read()

base64_content = base64.b64encode (file_content) .decode('utf-8')
print (base64_content)

json_ data = {
"filename": s3_key,
"base64encoded": base64_content
}

json_string = json.dumps (json_data)

new_s3_key = s3_key + '.json'
print (new_s3_key)

s3.put_object (Body=json_string, Bucket=s3_bucket, Key=new_s3_key)

# Return the new S3 file key
return new_s3_key

```

**Flow 2: Get the new file from Amazon S3**

1. Create your Amazon S3 export. Parse the JSON file.
2. **Import your new file** [**into any application**](https://docs.celigo.com/hc/en-us/p/Connectors) **.**

---

<div class="post-metadata">

**Author:** ![maartenpanman](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@maartenpanman](https://connective.celigo.com/u/maartenpanman)\
**Post date:** [May 28, 2024, 7:51am UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/2 "2024-05-28T07:51:28Z")

</div>

Are there other ways to do this. Is there something on the roadmap?

---

<div class="post-metadata">

**Author:** ![rohitprasad](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rohitprasad](https://connective.celigo.com/u/rohitprasad)\
**Post date:** [May 28, 2024, 8:39am UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/3 "2024-05-28T08:39:44Z")

</div>

Hi @maartenpanman

Thank you for reaching out. At present, its not on the near-term roadmap.

Best Regards,

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [October 21, 2025, 9:02pm UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/4 "2025-10-21T21:02:38Z")

</div>

I built a different way to do this which is all in Celigo. If you go to the marketplace, you can find it under "Blobkey Conversion Helper".

 ![The image shows a software interface with a list of integration apps and templates, featuring the 'Blobkey Conversion Helper' within the Celigo Marketplace. (Captioned by AI)](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/0/0097d17112ecac60b2277a410e8c3ae04501bbce.png)

With this being said, you normally do not need to use this. Normally, if you need to send base64 to your endpoint, you'd do something like this if you already have a blobKey:

> [@Importing a NetSuite file to HTTP endpoint, help](https://connective.celigo.com/t/importing-a-netsuite-file-to-http-endpoint-help/5722):
>
> I need to pull out a file from NetSuite then send the file to a HTTP endpoint. The endpoint requires the payload in JSON format and the data to be in base64. I have a step that gets the blobkey from NetSuite and a step HTTP Import (Transfer file to Application) step. I cannot seem to get the file to transfer… below are screenshots from the HTTP Import transfer. Can anyone provide any guidance here for me?

If you need to convert base64 to blobKey, then you normally would use the "Look up additional files (per record)" option for your lookup and then maybe set the "Path to file in HTTP response body" if the base64 string isn't send in the raw response body. This will give you a blobKey to use.

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/e/e9e978747616f7402fe8acdbd57ceb25c2fad2ba.png)

---

<div class="post-metadata">

**Author:** ![jackharris](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/jackharris/32/6618_2.png) [@jackharris](https://connective.celigo.com/u/jackharris)\
**Post date:** [March 12, 2026, 4:46pm UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/5 "2026-03-12T16:46:55Z")

</div>

> [@tylerlamparter](#):
>
> Blobkey Conversion Helper

I tried using it and I couldn't get it to work. It created a blank request and returned blank.

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/0/01e38029da60f3f671978951a1b074bd2cf27970.png)

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/8/878c8afbeb6f0108fef18ee01b29aa01e7f85882.png)

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/a/ad38127f64387e55b7836e6db3c757ca084959c0.png)

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/7ac62c10aa1a8b9be0843def282c32e6f37fd7d3.png)

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/8/897bc7c57fadee8bdf0bf0583a0d0d2a28ffd1f7.png)

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [March 14, 2026, 4:55pm UTC](https://connective.celigo.com/t/faq-convert-a-blob-key-to-base64-string-for-import/358/6 "2026-03-14T16:55:23Z")

</div>

`record.blobKey` would be the wrong path. Use `blobKey`.
