The file and image proxy can be used to create permananent urls for your Airtable attachments, to solve the issue of expiring image and document links when syncing to external databases and in emails.
The attachments will be cached, so they won’t update automatically if the Airtable data changes, to learn how to work around this.
Now this tool has been launched for a while, and we (our team) use it extensively ourselves we have gathered a few neat tricks for making it much easier to handle in the Airtable side.
NOTES
Quick Start
If you’re short on patience and want to jump straight in heres the summary…
Follow the setup process in the tool UI. Add a formula field to Airtable. Insert your ‘sharing link’ with the record_id at the end. Click any link to see the attachment. (these links will never expire) When you want to use the attachments in external systems, use the link in the forumla. You can also programatically create links (below)
Do I need a new project for every field?
No, although you can nominate an attachment field to use by default, in recent updates we have made it so that you can programatically specify a field name at the end of the url and the system will find it. So you only need one project per table.
… /recgwYHz5rbTewvl5/myimage
Multiple Attachments
For most situations, because the images are accessed by creating an Airtable formula for the URLs there is no way to specify individual attachments. So by default, they return the first attachment.
If you have access to the attachment id - just add the specific attachment id to the end of the url as a parameter (attachment) like in the example below and the system will return it.
… /recgwYHz5rbTewvl5?attachment=att9AwQ0UQ3rSeJwM
File Extensions
Some older systems can only recognize the type of file based on its extension, so you can programatically add the extension onto the urls. Our endpoint will ignore the extension and return the correct image type based on the data from Airtable, but you should ensure you add the correct extension so that your system handles the file correctly.
This option is more for developers, so we have not added it to the UI.
Choose the Attachment Field
Each proxy will work for any field, but you need to choose the default incase none is specified in the url. If there’s multiple attachments in the field only the first will be returned.
You can make urls programatically that will work with any field, and any attachment. Refer to the notes at the top of this page.
Choose a Proxy Type
It is very important to choose the correct proxy type as they behave differently and serve different purposes.
Display Image
When you choose ‘Display Image’ as the type, the urls can be used in your websites, emails etc and displayed as images. This type of proxy is cached for one month, so you can use them in large scale but you should never use them for private or confidential documents.
Use images for displaying images on a page.
Show in Browser
The document proxy uses a different method, it does not cache your files. Instead, when a link is clicked, a new url is requested from Airtable and the user is redirected to it.
Use documents for linking to files.
Download File
Use this method if you want to download files after clicking a link.
Once you have chosen the field, and the type of proxy you want to use - you should be ready to test the links by clicking some, and then continue to set them up in Airtable.
Image Sizes
We have recently added the ability to specify the image size as a parameter so you can choose between the compressed (small or large) versions, or the full sized image.
To get the full sized image in urls, add the ?size=full parameter at the end of the url.
Create Links in Code ⭐
If you’re a developer and you know how to programatically build urls with field names and attachment ids, you can make the proxy work for all attachments in a table using just one token link.
Refer to the notes at the top of this document.
Create Links in Airtable.
You may have noticed all the urls are mostly the same, and the end is just the record id. This means you can copy it and create the same url structure in Airtable as a formula field..
Or click this button and copy url formula.
And paste it as a value of your formula field
Clicking any link to make sure they are working.
Now you can sync these urls to any system and embed them in emails, and as long as your proxy exists people will be able to access the attachments.
Removing Access / Cancelling Links
If your links have been shared to places or people you do not want to have access - you can change the token. This will make all the previously shared links invalid and they will stop responding to requests.