Pro-grammatically upload/create attachments

Greetings devs!
First post here after doing a bit of googling to no avail…
I’m looking for an example of how to upload a zip archive to an attachment field. In the documentation there is mention of attachment objects but no mention of how to create one pro-grammatically. Any sample code or general guidance would be helpful regardless of language although Python would be greatly appreciated!



Welcome to the Airtable community!

In order to upload an attachment with the API, the attachment must first exist at a publicly accessible url. So, you must first upload your attachment to some other web service, get the url for it, then use that url with your create/update request.

1 Like

Are you saying that AirTae will transfer the file from the public endpoint to its own storage? I’m not looking to create an external link via the attachment object. What I am looking for is a way to upload a file to AirTable in much the same way AirTable’s drag and drop web UI does it when one attaches a file uploading from a local device. When one uploads a file in this way an attachment object is created which has a url that points to https://dl.airtable.… Is this a web UI feature only? I do not want these files to be public and I’d prefer not to have to click around in the UI to accomplish this task.

Yes, Airtable will retrieve the file from the public url and make its own copy to store as an attachment. Once the attachment is uploaded, you can delete the public version. The attachment create with the API will also work exactly as any other attachment created in the UI.

@UME_System Since you mentioned concerns about your attachments being public, one thing you should note is this:

Once your attachments are in Airtable, and once a user of your Airtable base has access to the https://dl.airtable URL of an attachment, that attachment will always be publicly visible via that URL to anyone who gets hold of that URL… even if you delete the attachment from Airtable.

Even if you delete the attachment from Airtable, the attachment lives on publicly at that URL for an indefinite amount of time (presumably 1 year, if you are on the Pro plan).

But that https://dl.airtable URL does not sit behind any type of security. If a user distributes that URL to the general public, or even if the user themselves goes back to that URL a year later, the attachment will still be visible.