Forum Academy Marketplace Showcase Pricing Features

Handling Form Data

Hi, I’ve got an API that does some off-site processing but needs the binary form-data passed in. Is there a way to get the binary data from either the image or file uploaders? It seems that I can only get the path or other values parsed off the file (like file size, etc).

I’m writing a tutorial and want to make sure I’m showing the right way to do this. My backup plan is to do a custom HTML form on the page, but that doesn’t feel very “low-code” :smile:

Any advice is appreciated!

Ideally, I’d like to choose an image with a file-picker, and fire that binary off to an API of my choosing.

You need a way to convert a file to binary.
A plugin like this will help: File Converter - Binary or Base64 Plugin | Bubble

There might be a free option too, you could explore the bubble plugins with base64 or binary as keywords. This should give you a way to use the file uploader’s file to generate a binary string.

To make the API call, go to the API connector in bubble and set up the API call as a POST call and mark the ‘data type’ as Form Data.