Skip to content
How to convert bina...
 
Notifications
Clear all

How to convert binary data into a file

7 Posts
3 Users
0 Reactions
4 Views
mdb213
(@mdb213)
Posts: 10
Active Member
Topic starter
 

I'm looking to use logo.dev to retrieve company logos. It functions via a custom URL and returns the logo's binary data to callin.io.

Is there a method to convert this data into an image format that can then be inserted into Airtable?

Thanks

 
Posted : 25/11/2024 5:57 pm
Donald_Mitchell
(@donald_mitchell)
Posts: 36
Eminent Member
 

Hey,

I think the data is already in "File" format, making it ready to be uploaded as-is into a module that requires a file, such as Dropbox or Google Drive.

Once you have a publicly accessible URL for the file, use that as the source for uploading to Airtable, as Airtable modules do not accept files directly.

 
Posted : 26/11/2024 1:36 am
mdb213
(@mdb213)
Posts: 10
Active Member
Topic starter
 

Thank you for taking the time to respond. It does not seem to be, and it also doesn't appear to be Base64 encoded.

Logo.dev is a useful tool that retrieves a logo from a specified website. For instance:

I utilized the HTTP module, and it returned the data block correctly. However, when I attempted to use it with Airtable, I encountered an error:

My ultimate goal is to process a table I have and retrieve as many logos as possible.

Mike

 
Posted : 26/11/2024 8:39 am
dilipborad
(@dilipborad)
Posts: 28
Eminent Member
 

Hello,
Airtable supports two distinct methods for file uploads.

Upload a File Directly

Airtable now supports uploading files directly, as per their API updates in July 2024. You can find the details here Changes 2024-07-31.

The specific instructions are:

  • Upload an attachment up to 5 MB to an attachment cell using the file bytes directly.
  • The file parameter requires a string, which is the base64 encoded string of the file to be uploaded.

You can find more information on this here Upload attachment.

Note: An important observation is that this method specifically works when updating Airtable records. You will notice the {recordId} in the URL.
<<<BLOCKQUOTE:
{recordId} is present if the record has already been created.
>>>

Upload file Via URL

As suggested, if direct public URLs are available, use them as the attachment input.

I hope this assists you.


:bulb:

P.S.: Always search first. Check the callin.io Academy (Make Academy course overview). If this was helpful, please mark it as a solution

:white_check_mark:

and

:+1:

Need expert assistance or have questions? Feel free to comment below!

:point_down:

 
Posted : 26/11/2024 8:52 am
mdb213
(@mdb213)
Posts: 10
Active Member
Topic starter
 

Appreciate you taking the time.

So, are you suggesting I avoid the Airtable Update node and opt for an API Call instead?

The response from the URL isn't Base64, but there is a specific URL provided.

 
Posted : 26/11/2024 10:12 am
Donald_Mitchell
(@donald_mitchell)
Posts: 36
Eminent Member
 

You would essentially go directly from HTTP Make a Request → HTTP Make an API Key Auth Request.

Normally, you would use Airtable Make an API Call, but this won't function because that module specifies compatibility with the api.airtable.com domain, whereas the Upload Attachments function requires the content.airtable.com domain.

For this reason, you need to use Make an API Key Auth Request. Set up a new connection to Airtable using your PAT (the simplest method) or OAuth (refer to the Upload attachment API page for details on the necessary scopes).

In summary, you have at least a couple of options:

  1. HTTP Make a Request → Upload to file share service, obtain public URL → Airtable Update a Record (utilizes more Ops and data, simpler to configure)
  2. HTTP Make a Request → HTTP Make an API Key Auth Request (uses one less op and less data, but slightly more complex to set up)
 
Posted : 26/11/2024 4:26 pm
mdb213
(@mdb213)
Posts: 10
Active Member
Topic starter
 

That makes sense. Thank you, I will try it first thing in the morning.

 
Posted : 26/11/2024 5:35 pm
Share: