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.
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.
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.
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.
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.
@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.
My question is simple, as this post has been around for a while now
Is it possible to upload a file in a field of a record without first uploading it to a non-Airtable server?
Thank you!
I would like to bump this as well. Pretty ridiculous to still require a public link to upload private documents; especially given the fact that Airtable links are now expiring for security reasons and the fact that this ask has been out for three years now. Honestly; I'm very surprised there isn't a differentiation between private attachments and public attachments. They really should be separate field types in the table creation process. Private documents should only be accessible from logged-in users with correct permissions or via API with a properly configured PAT. This two hour timeout thing is a cheap substitute for real security.
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.
Hi @kuovonne ! How do I tell airtable to retrieve the file from the public URL to make its own copy to store as an attachment? I have the URL, just not sure how to get airtable to automatically extract the document and upload it to a document field.
Hi @kuovonne ! How do I tell airtable to retrieve the file from the public URL to make its own copy to store as an attachment? I have the URL, just not sure how to get airtable to automatically extract the document and upload it to a document field.
@Sarah_MacGregor Is your public URL in an Airtable field? You can use an automation to upload the attachment. Use an "update record" action where you copy the url to the attachment. Or you can use scripting.
So this is not a solution to the problem. If you are using Airtable and are AUTHORING these documents (I am), to have to render them to a public URL in order to have Airtable copy the content is a bit ridiculous. You should enable the ability to provide the document as a part of the create, or, perhaps enable a:
const id = ...stageAttachment(content);
const res = await base(table).create({ ..., attachmentId: id});
if you don't want to support that in the create.