Help

Formula for Direct Download Links of File

4892 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Ben_Frederick
6 - Interface Innovator
6 - Interface Innovator

I’m using Airtable to manage designs for a t-shirt business. I upload the transparent PNG files to the table and I use some tools that need the direct download link for that file. I was able to get the URL for the file using this formula:

RIGHT(LEFT(Interior, LEN(Interior) - 1), LEN(LEFT(Interior, LEN(Interior) - 1)) - SEARCH(“https://”,Interior) + 1)

But it only opens the file in the Airtable Viewer. I need it to download directly to my computer when the link is visited.

Possible?

3 Replies 3

What you’re seeing isn’t the Airtable viewer. When fed direct links to certain content like images, PDF files, etc. Most browsers opt to display them instead of offering to let you download them. In other words, it’s just your browser trying to be helpful. If you take that URL and feed it into a tool that will download the content locally, it should work.

@Justin_Barrett hits the name on the head: It has to do with the interaction between the browser and the server, coupled with your local settings. Unfortunately, Airtable grabs control of your right mouse key, so you can’t do the usual right-click-and-download-as trick. There are extensions out there that allow you to move that function to another key/mouse combination, though; yhou’ll want to search for one that works with your browser.

Interestingly, on Chrome, at least, if I change the name of the file from ‘image.png’ to ‘image.bin’ and upload it as an attachment, when I click on the resulting URL, it downloads rather than displays. That’s not the interesting part: The interesting part is that the browser parses the incoming file and stores it as ‘image.png’.

Ah-ha! you think. I’ll just create a formula field that wraps my attachment URL with a SUBSTITUTE() function replacing 'png' with 'bin'. Alas, 'twas not meant to be: Airtable sees the resulting text as a URL, and it attempts to start the transfer — but then issues a ‘file not found’ error. (Well, actually it’s ‘access denied’ – but it means the same thing.)

Unfortunately, the file display library Airtable uses doesn’t try to identify ‘.bin’ files, so any image uploaded with a ‘.bin’ extension can’t be opened in the browser; instead, it shows as a generic document.

These tests are all performed with a Windows system; conceivably the results might be different from an iOS machine. (Do Apples even use resource forks these days?)

Which “bud” are you referring to, and what formula? The OP shared a formula to get the URL for an attachment. @W_Vann_Hall briefly mentioned a formula in the middle of his reply, but he also pointed out why it wouldn’t work.