Sep 02, 2022 08:09 AM
I have a script that is creating (by sourcing data from airtable tabs) a large text result that I would like to store as a file attachment column in airtable.
I cannot see how to take a text variable (e.g. 1000 lines of text) and turn it into an attachment in an airtable attachment column, all within a script.
I would much prefer to be able to do this all from within the script, rather than POSTing the content to some file store site on the internet and then adding that URL to the attachment.
Sep 02, 2022 08:13 AM
Welcome to the Airtable community!
You are not the only one. However, for now, this is what we must do.
Sep 02, 2022 08:16 AM
Thanks very much for the prompt reply.
it it possible to pretend to be the browser and post (from the script) the content of the file to the Airtable API? and create the attachment via that route?
Sep 02, 2022 08:46 AM
The Airtable REST api has the same limitation. The file must be at a publicly accessible url.
Jan 11, 2023 06:36 AM
I would love to do this as well. You can create a file, or a data url, in JS, but there is no way to add it as an attachment currently. Could you share how you send your file to a publicly-accessible host as a stopgap?