Hi @sue, i’m trying to recreate the Photo Saving app and something doesn’t add up with regards to saving and displaying the images.
In the collection page you display the images using the image url.
But in the Upload Photo page you sent a base64 encoded string of the image.
Am i missing something. If the image is being saved as a base64 encoded string why are we retrieving it with a url.
For anyone who may have similar concern like above here is the answer i figured out myself.
Since in the example app the image was being saved into a bubble database, they were following the process of saving images in bubble database.
Bubble allow you to upload files on S3 by doing the following :
Files and Images: When a parameter is a file or image, you have two ways to define the content in the request. You can submit a string, which should be the URL of the file/image hosted on a storage service, or you can provide the raw data and the API call will upload the content to Bubble’s hosting services. In the later case, the value provided should be a JSON object as follows:
contents: Base64-encoded binary data
– filename is the file name. Optional, but recommended to get the file type.
– contents is the base64-encoded binary data of the file. Required.
– private is a boolean, true/false, that defines whether the file is protected and attached to an object in the database. See Privacy rules for more information. Optional.
– attach_to is the unique ID of who/which thing owns the file. Required if private is true.
So in the example Photo Saver app, that is the reason why the photo was been sent using the filename and contents parameters.
The confusion here is that when you just create your api endpoints in bubble and export your swagger (json file) image fields will just be string parameter field.
This means you will have to manually edit your swager file so that the image parameter is an object with at least the fields, filename and content.
Note that anytime you update your api and endpoints in bubble and export you will have to manually fix this again.
I wish Dropsource will have mentioned this in their Photo Saver app page. Took me some time to figure realized this.
For more info on saving data to bubble see the reference page here: