Hi all
Looking for a quick and simple way to convert PDF files to BASE64 so they can be sent via email.
Using both the Bubble.io single file and multi file uploader. Files are private.
Thanks
S
Hi all
Looking for a quick and simple way to convert PDF files to BASE64 so they can be sent via email.
Using both the Bubble.io single file and multi file uploader. Files are private.
Thanks
S
Hi @klobassimon,
In most situation you want files to be private since that prevents unauthorized users/people from accessing them. However, the single and multi file uploader only make files private if you configure them to do that. By default making files private is not active and if it is, simply deactivate it by unmarking âMake this file privateâ:

Bubbleâs standard send email action has the option to attach a file (see image below), you dont need to do anything with base64 encoding.
But if you really need it, Bubble has the option to encode in Base64 by default:
Hope this answers your questions. If not, do you mind to explain a bit more what you are trying to achieve?
Best,
Gerbert
MOG Consultancy / MVP Design
Iâm not sure what the workflow isâŚ
But in some cases my plug-in Better Uploader might be of use to you. When you give it a file, it exposes the file (of any type) as a base 64 value (a Data URI) in the Raw Data exposed state.
Although, if what youâre asking is how to convert pdf to data uri on the fly the other answer might be helpful
Cheers
Thanks for all the info. Weâre looking to send via Sendgrid (using CoPilot plugin).
We have got the private files sorted, and we are storing the base64 code in the DB at the time of upload.
Maybe it is simpler than I think and we just need to somehow combine the file URL and teh base64 code in the file field when sending the email. Is this correct or is there something that needs to happen at the point of uploading the file.
S
Hi @klobassimon,
It seems you are doing everything right. It is probably just a step that is missing or wrong config somewhere. Here is an example, it should clarify things:
This should work, if not, just add a couple of screenshots of your configuration and workflow and we should be able to find out what is wrong.
Hi Gerbert,
Thanks, my email is still coming across unformatted.
I have attached the file as âfile - encoded in base64â AND also I have first converted the file to base64 using a plugin and have tried to attach that data as the file. Both to the same result.
See attached screenshot of the workflow and the receipt email.
Any help appreciated.
S
That is unfortunate. Then we need to rule out some things. Often times it is the privacy rules that cause the issue (actually the improper use of privacy rules
). Do you mind to turn of the option âMake file privateâ in the uploader element, upload a new file (important) and try to attach it to the email like I showed you? Maybe even create a new workflow for the time being (to rule out some under the hood Bubble bug).
Hi K, that is strange. Did you recreate the workflow in order to be sure it is not a bug that is causing the issue.
Anyway, if you are OK with it, you can set your app to âeveryone can viewâ so that other can have a look at it (Settings - General - Define who can see and modify the app). Do you mind to do that and send the link to the editor (not the public)? You can PM it if you donât like others to have a look in âthe kitchenâ?
The link will look something like this: https://bubble.io/page?type=page&name=index&id=âyour-app-idâ.