How to upload Base64 data in server side Bubble plugin action?

How to upload Base64 data in server side Bubble plugin action?

Converting various file types, such as images and PDFs, into base64 strings is an excellent method for storing them in a database. Bubble's File API only permits base64 data uploads, disallowing direct uploads of PDFs and images.

By default, Bubble exposes the "fileupload" API for uploading base64 data.

Use the following code to upload Base64 data to Bubble File Manager.

var payload = {
        name: properties.file_name,
        contents: base64_data
    };


var options = {
    uri: properties.website_home_url + "fileupload",
    method: "POST",
    json: payload
};

const response = await context.v3.request(options);

That's all for this blog. Subscribe for more future updates. Thank you!

Follow me on Twitter.

Checkout My Bubble Plugin Course - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.