Hey @david12 - the way I did it was to create an API Workflow like this:
Where Pattern is a Bubble “thing” in our app. It has a field patternImages
that is a list of images.
Inside the workflow I set it to save to S3 (using patternImages add
because it’s a list):
And finally, I called the API from another script using JavaScript (you could just do a plain PostMan request, or whatever)…
fetch(`${bubbleBaseURL}/pattern-upload-image`, {
method: "POST",
body: JSON.stringify({
pattern: patternId,
img: { filename: name, contents: base64Image }
}),
headers
})
.then(r => r.json())
.catch(console.error);
The important part here is the pattern
and img
parameters that match the workflow parameters. Also the format for the image is parameter is{filename: <whatever name you want>, contents: <the image Base64 data>}
.