Hey Bubble Crew,
I want to save a pdf as a file in the bubble database rather than the base64 response I get from an API connector so I can then attach to an email and send. I don’t want to use a paid plugin as it seems something really simply achieved - just a bit elusive to me right now.
The following javascript works perfectly in the browser downloading the pdf file returned from the API call but I just don’t know how to achieve this in the backend?
Also, less important to me - is there a way to download a base64 file if it is stored as text in the database?
THIS IS JAVASCRIPT CODE THAT WORKS IN THE BROWSER - ALLOWING ME TO DOWNLOAD THE PDF FROM A BASE64 RESPONSE
let a = document.createElement(“a”);
let data64=“Result of step 1 (PDF Generator - p…)'s response”;
a.href = “data:application/octet-stream;base64,” + data64;
a.download = ‘filename.pdf’;
a.click();
console.log(a);
any help greatly appreciated.