Skip to main content
Solved

Is it possible to upload attachments?


Did this topic help you find an answer to your question?
Show first post

38 replies

  • New Participant
  • 1 reply
  • February 16, 2019

Thank you Chinara and +1 for adding this functionality to the API!!


  • New Participant
  • 2 replies
  • March 13, 2019
Nico11 wrote:

+1. Does anyone know a service to temporary upload some images?


I use Cloudinary which comes with its own set of image processing APIs. Free tier is great.


  • New Participant
  • 1 reply
  • March 8, 2020

Is it possible to use a data URI for the attachment.url value when updating attachment fields? I am was hoping for something like this to work as a compromise to not being able to send the file directly:

PATCH https://api.airtable.com/v0/.../rec00000001
{
  "fields": {
    "myAttachmentField": [{
      "id": "xxxxxxxxx",
      "filename": "file.json",
      "url": "data:application/json;charset=utf-8;base64,..."
    }]
  }
}

But this yields the INVALID_ATTACHMENT_OBJECT error.


  • Participating Frequently
  • 5 replies
  • May 26, 2020
Emmett_Nicholas wrote:

Right now this isn’t possible with the Airtable API alone. It’s something we’ll think about for future API versions though. A workaround for now is to use a different service (e.g. Filestack, imgur, etc.) to process the upload before then sending the url to Airtable. When Airtable processes the attachment, it will copy the file to Airtable’s own (S3) server for safekeeping, so it’s OK if the original uploaded file url is just temporary.


I’d like to secure this process.

Is there a specific range of server IPs from which the image will be retrieved? Are there any guarantees on timing between when I make the create record POST request to Airtable and when the image will be fetched (e.g. no more than 5 minutes)?

I’m thinking of generating S3/Cloudfront Signed URLs with a short expiration just for Airtable to fetch it.

Ideally, if you could provide us with your AWS account number, we could set up a bucket policy that only allows your AWS services to access our buckets. It shouldn’t take much work to support this on your end. Cloudinary has an example of this workflow.
https://cloudinary.com/documentation/upload_images#how_to_set_read_access_on_a_private_amazon_s3_bucket


It’s january 2021, and this feature is not available yet :confused:


There is an easier solution that does not involve third parties. You can simply save all your documents in a folder - that you then host on a http-server. Use a service like nginx to serve that folder over http, or even https. Then as you save the documents, you also pass the http/s address to the Airtable API - I tested it and it works, will write a code snipet for python in a tutorial soon . . . . . NOTE: I found, you should not immediately delete the files, maybe create a function to delete the files from your server after a couple of seconds, to prevent clutter.


Forum|alt.badge.img
  • New Participant
  • 1 reply
  • November 16, 2021
Bertha_Kgokong wrote:

There is an easier solution that does not involve third parties. You can simply save all your documents in a folder - that you then host on a http-server. Use a service like nginx to serve that folder over http, or even https. Then as you save the documents, you also pass the http/s address to the Airtable API - I tested it and it works, will write a code snipet for python in a tutorial soon . . . . . NOTE: I found, you should not immediately delete the files, maybe create a function to delete the files from your server after a couple of seconds, to prevent clutter.


Ah nice! Saas that requires you to also run your own server in parallel, and host all documents in public view :slightly_smiling_face:


Forum|alt.badge.img+3
  • New Participant
  • 2 replies
  • December 9, 2021
Emmett_Nicholas wrote:

Right now this isn’t possible with the Airtable API alone. It’s something we’ll think about for future API versions though. A workaround for now is to use a different service (e.g. Filestack, imgur, etc.) to process the upload before then sending the url to Airtable. When Airtable processes the attachment, it will copy the file to Airtable’s own (S3) server for safekeeping, so it’s OK if the original uploaded file url is just temporary.


Hi! No news for this Upload feature? Thanks


  • New Participant
  • 1 reply
  • January 18, 2022

The weird thing about using Cloudinary though, is that Cloudinary is a much better image management solution than Airtable. But, using it as an intermediary, Airtable will copy the file to their own server, and display it as an attachment. So when you go to edit your Airtable, you will be able to delete or re-upload a different image. But unfortunately, this will not sync/update to your Cloudinary. So your Cloudinary will still have the original image. This may become confusing. Alternative is to use Cloudinary, and upload the URL to Airtable as plain text. Then, you will remember that Cloudinary is the source of truth.

Cloudinary has a strict limit of 10mb per file. Or 20mb if you pay for the premium account. So that is something to keep in mind.

I’d like to find some image/file hosting service that is free, disposable, and has no maximum file size, to use as an intermediary. Ideally, it will delete the files I upload to it after some time. Then, I can just use Airtable to manually edit/re-upload the files, after they have been uploaded via the API.

Cloudinary is superior because it lets you resize/optimize/crop images. But, here’s a great trick… CloudFlare also has this, for $20/mo. It lets you pass in any image, from any domain, to their URL, and it will resize/optimize/crop it for you just like Cloudinary does.

Wondering what people think, if this makes sense? I too was hoping to manage all my data, content, and files/images in Airtable.


Forum|alt.badge.img+6
  • Known Participant
  • 17 replies
  • July 10, 2022

Did anyone find a solution in the meantime?


Forum|alt.badge.img
  • New Participant
  • 1 reply
  • August 17, 2022

We are really missing this feature. Uploading file using 3d-party service is very inconvenient. Could you please rise the priority of this feature in your backlog? Thank you.


  • New Participant
  • 1 reply
  • October 25, 2022

Hi, I tried to build an App in Thunkable that can upload pictures into Airtable. I’m thankful I found this post. I’ll be very grateful if this can be done natively. Thank you.


ng010105
Forum|alt.badge.img+7
  • Participating Frequently
  • 12 replies
  • June 16, 2023

HERE IS The working solution

curl -X PATCH "https://api.airtable.com/v0/{baseId}/{tableId}/{recordId}" \ -H "Authorization: Bearer {YOUR_TOKEN}" \ -H "Content-Type: application/json" \ --data "{\\"fields\\": {\\"attachment1\\":[ {\\"url\\": \\"https://www.redcross.org.hk/sites/redcross/files/index_top/Agency%20website%202880x1900%20%20bilingual%20add%20gold%20flag-01_1.jpg\"}]}}"

 

https://support.airtable.com/docs/finding-airtable-record-ids

 


Reply