Upload an image to Airtable with a temporary URL

Hello everyone,

I would like to upload an image that I previously generated with OpenAI and edited with Edit Images Nodes to Airtable. However, this does not work because Airtable only accepts URLs. This means that I first have to upload the image somewhere. I would like to do this on a temporary service (not on GDrive, for example). Ultimately, the image should only be stored in Airtable in the long term and nowhere else. Can you recommend an option? I asked ChatGPT about this and tried file.io and tmpfiles.org, but unfortunately they don’t return JSONs, only HTML files, without a URL to the file anywhere.

tmpfiles does return JSON

curl -F "file=@/Users/user/Downloads/n8n-color.png" https://tmpfiles.org/api/v1/upload

{
  "status": "success",
  "data":{
    "url":"http://tmpfiles.org/1392593/n8n-color.png"
  }
}

1 Like

That’s strange. I configured the node exactly as you did, and I always get the HTML on the right. Am I overlooking something?

Hey, could you try:

  1. Could you try copying the exact node from Jabbson’s workflow into a new workflow that only has it + the binary node and test again? What happens?
  2. Let us know the version of your n8n instance and the version of the HTTP node ( in its settings) just in case

Also feel free to share your version, we can take a look to see if there is a difference in how your workflow executes for us.

Thank you both.

jabbson, I copied your HTTP Request Node exactly into n8n and uploaded a file via an n8n form. Here, I actually get the desired JSON back.

Then I pasted your HTTP request node into my workflow. But there, I only get the HTML back again. So the problem can only be with the input, if I’m right? As a reminder: I generate the image with DALL E and then edit it with a few nodes, and I want to upload the result.

The strange thing is: when I download the file from the ‘Website ergänzen’ and upload it to the test workflow, which only contains the N8N form submission and the HTTP request node, it works again.

The versions:

  • HTTP request node version 4.2 (latest)
  • N8N version: 1.110.1
1 Like

I see what the issue is. In the last Edit Image node, set the name for the file.
After this your upload will be successful.

PS:
actually this can be done in any of your edit image nodes.

Here is an example:

The first Edit Image node sets the file name in above example.

Hello jabbson. Thank you very much. That worked. The result is now in JSON format.

I was also able to successfully complete the Airtable entry, but there is a problem with tmpfiles in general: Airtable does not upload the image itself, but rather an HTML file on which the image can be seen. When I click on the link manually, the same HTML file is displayed, and even when I upload an image manually to tmpfiles, I can’t get the URL for the image directly. When I right-click on the image, I am redirected to another website that has nothing to do with my image. This appears to be malware, so please do not use tmpfiles!!!

Do you know of another service where you can temporarily host images?

I see the problem. The url to an actual image contains an extra part in its path. Here is an example:

You get a url like
https://tmpfiles.org/1626849/data.jpg
what you need to get an actual image:
https://tmpfiles.org/dl/1626849/data.jpg

I assume dl stands for download.

There are a number of ways to add that to the url, here are two for you:

Cheap, dirty, hacky, ugly looking regex, but it works.

Another, more appropriate and reader-friendly way:

1 Like

Thanks for your help. Finally it worked. :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.