Saving images as base64 along with other fields

I thought this would be quite straightforward, but I’m having mixed results when working with images and outputting base64.

This is what I’m trying to do - the user uploads an image, bubble should encode this into base64. I’ve used the operator built into bubble, but the base64 output is only a few lines vs the hundreds of lines I’m expecting. Not sure what is going on there. It doesn’t generate the image at all.

I’ve used a plugin called “file to base64” which works, but it precedes each base64 with “data:image/png"base64” which doesn’t work with my API endpoint - I need to format this differently. Instead I want to remove this prefix and add my own. I’ve tried using the find and replace in the workflow, but then for some reason the entire base64 string disappears.

My options are:

  1. Either use bubble’s in-built base64 encoder but find a solutions as to why the actual output is incomplete (maybe I’m not doing it right?), or
  2. Find another way to remove this prefix that doesn’t disturb the saving of the entire string.

Any other options appreciated!

The built in Bubble option should work, what does it output? IF the image isn’t in Bubble storage it probably doesn’t work.

If you use the plugin it should output data:image/png;[base64] you just need to do :split by ";":last item to get just the data

This is all that bubble outputs

eyJlcnJvcl9jbGFzcyI6IlVuYXV0aG9yaXplZCIsImFyZ3MiOnsiY29kZSI6IjE3MjY3NjczNjI5NjJ4NTY5MzM5ODE1Nzc1MzY3NTAwIn0sIm1lc3NhZ2UiOm51bGwsInRyYW5zbGF0aW9uIjoiUGVybWlzc2lvbiBkZW5pZWQifQ==

Not sure if it’s an issue with storage - I haven’t asked it to be stored anywhere else specifically.

This is also what the syntax looks like in case I’ve got it wrong.

Screenshot 2024-09-20 at 08.44.11

So the split by expression, would that be “,” given this is the actual prefix?
data:image/png;base64,

Yea whatever character is right before the data you would split by that and do :last item

Also that bubble base64 data looks like an API Key :joy:no idea where that is coming from