I’ve a “download” button in my app. When button is clicked, it runs a workflow with " Run javascript" plugin to download the file which is mentioned as a link from Bubble’s File Storage.
The javascript code is:
const a = document.createElement(“a”);
a.href = “https://HIDDEN.cdn.bubble.io/HIDDEN/image.png”;
a.download = “image.jpg”;
a.click();
But it ends up oening the file in the browser (“Chrome” in my case).
I understood that if server sends “Content-Disposition” set to “attachment” then browser does the right thing. If so, how do I get Bubble Server to send this header for files it serves? If not, what’s the best way to accomplish “Download” ?
Thank you for your help.