Forum Academy Marketplace Showcase Pricing Features

Save Base64 encoded file to Bubble

Hey everyone,

I have an API Workflow that returns a Base64 encoded audio file which I want to save to Bubble.

I can’t seem to find a way of decrypting the base64 down to a MP3 and saving it as part of a workflow, there are a few plugins but seem to be client side only.

Bubble seems to support encrypting to Base64 nativly but I’m a bit stuck for decrypting… if anyone has an idea of a solution would be great!

Thanks, James.

I’m attempting to write a new plugin to do this, I’ll release it back to the community if I can get it working.

I’m currently trying to get the following working as a server side action to decrypt the base64 string and return a file but it’s not working.

Does anyone have any suggestions what I might be doing wrong? :slight_smile:

function(properties, context) {
    return { 
        output: Buffer.from(properties.inputText.replace('data:audio/mp3; codecs=opus;base64,', ''), 'base64') 
    };
}

Hi @jamesdevonport,

I think that @lottemint.md Sergey can give you an help on that, as I will need it in the future also. In my case “application Octet/Stream” for a wav file didn’t work too.

1 Like

Hello @jamesdevonport,
As I understood, you are trying to save a file.

Take a look at the following link, please:

You need to send that content to an API workflow that is waiting for a file:
image

2 Likes

@JohnMark @lottemint.md Thanks both for the help on this, looks promising! I’ll have another go based on this and let you know how I get on :+1:

2 Likes

@JohnMark @lottemint.md Thanks so much, followed these steps and it works perfectly! No need for a plugin now I can do it all through API Workflows :smiley:

2 Likes

Hi
It could explain how to set up the entire flow in Bubble.

I have a similar problem. I’m trying to get email attachments via the gmail API.

I cannot convert and save attachments received as a base64 string.

I tried to follow the previous information, but I couldn’t get it to work.

Thanks

I cannot seem to replicate this functionality. I have an API returning a base64 image. I can’t seem to get Bubble to accept it. Does anyone have any more in-depth instructions on how to use an API workflow to accomplish this?

@jamesdevonport @JohnMark @lottemint.md

Any ideas what I’m doing wrong here?

Called by API Connector:

Initialize gives this error:

Look at my plugin https://bubble.io/plugin/screenshot-generator-1610471760948x573297415344619500 and then the api menu. It makes uploading very easy using base64

Thanks! Question about the endpoint you are calling: [WebsiteHomeUrl]fileupload
Is that built in or is that an API backend workflow you’ve created?

When I try this, I get this error upon initialization:

"There was an issue setting up your call.

Raw response for the API
Status code 400
{“statusCode”:400,“body”:{“status”:“INVALID_DATA”,“message”:“Invalid data for key contents: not a valid url or object”}}

I must have the API endpoint configured incorrectly… The “content” key is set as “image” currently.

Ok, wow. Instead of my own API endpoint, I tried it out at the website_home_url/fileupload and hello built-in undocumented feature!

Thanks for pointing it out!

1 Like

If you add private & attach_to parameters, you can upload private files.

1 Like

Hey @jaredg - can you explain how to make the call?
Im trying to do the same thing but not super familiar with API endpoints.