Skip to main content
Question

Attach file from script without hosting in a third party site to get an url

  • April 23, 2025
  • 6 replies
  • 185 views

Forum|alt.badge.img+10

I’m wondering if its possible to create a file, encode it and then add it as an attachment. Since the attachment field needs a url the only way for me to do this would be to make an api call from within the script to store the file in an AWS s3 bucket, return that url and then attach. This seems like a huge work around. For now I can just use the raw text field in the text field, if the large text file fits, but for formated xlx files for example this won’t work. 

Seems like a long workaround just to output a file, is there another way to do this?

6 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • April 23, 2025

@BenFortunato 

Yes, you can use Airtable’s upload attachment endpoint to upload a Base64-encoded file into an attachment field.

Note that this method has a 5 MB limit per file. To upload files larger than this, you would need to use the URL method of uploading files.

- ScottWorld, Expert Airtable Consultant 


Forum|alt.badge.img+10
  • Author
  • Known Participant
  • April 23, 2025

Thanks for the response! I’m doing this from a script not the web api. Is it possible to do this from a script?


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • April 23, 2025

Sorry, I’m not sure about that one, because I do not use scripting. But hopefully somebody else can help answer that!


Forum|alt.badge.img+10
  • Author
  • Known Participant
  • April 23, 2025

Got it. So what are you doing, creating AWS lambda functions that interact with your base? I’ve done that a couple of times to get over the scripting timeout limits and to gain access to libraries I might need that are not available in the scripting environment. It just involves a bit more setup, either in the AWS console or with serverless framework https://www.serverless.com/ or SST. Curious about your setup, I’m going to try out SST https://sst.dev/. I’ve been using serverless. 


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • April 23, 2025

My workflow uses Make, so It’s different than what you’re trying to do.


Forum|alt.badge.img+10
  • Author
  • Known Participant
  • April 23, 2025

Got it. I experimented with make but found that it gets pretty expensive it you are trying to do something like write a lot of data to an excel. Its also pretty slow and hard to debug. Good for short simple workflows.