How to convert a PDF file to base64?

I designed an interface where a user can upload a pdf (File Uploader) and I need to send that pdf as part of a parameter in an API. That API wants the pdf in base64 format.

I tried with the plugin “Base64 File Uploader & Downloader” by Zeroqode but it comes out as empty, even tho the file is uploaded.

That operation you have in your screenshot only works in a backend workflow (see here). So, use that same expression in a backend workflow that saves the encoded value to a record, for example.

1 Like

This worked! Thanks!

Also, do you know if it’s possible to restrict the Fileuploader element so users can only upload PDF’s and not anything else like a .exe or something?

Hi @Pedro.Calle,

We’re so glad you’re interested in our plugins :hugs:

We’ll try to provide you with more information about them. The plugin you mentioned has the ability to upload files using the Base64 code you provide in the actions or download the file directly to the device.

Unfortunately, the plugin can’t accept files and convert them to Base64. You might want to check the Bubble Marketplace for a Base64 encoder, like this plugin (File URL to Base64 Plugin | Bubble). Just provide the file URL and you’ll get the Base64 string!

As @romanmg mentioned, the operator you added in the Display data action is only working on the backend of the application.

Please let us know if you need more information or have any other concerns!

Best regards :sunflower:

Browse all Zeroqode Plugins for Bubble Banner_Last3

1 Like

Tried that plugin and it didn’t work, the actions don’t even come up, I read the instructions and followed them, but I don’t even get the actions on the workflows.

Hi @Pedro.Calle,

Apologies for the delayed response over the weekend :pray:

Have you added the plugin element to your page? The actions associated with the specified plugin are connected to the element. This could be the reason why it’s not showing up in the list.

Best regards :hibiscus:

Browse all Zeroqode Plugins for Bubble Banner_Last3