Forum Academy Marketplace Showcase Pricing Features

[SOLVED] How to upload an image using POST API

Here is a Curl request that worked on another app.

Here you are, with a workflow called upload_image that creates a thing whose field is going to be the content of file.

curl -X POST https://yourappname.bubbleapps.io/api/1.0/wf/upload_image -H “Content-Type: application/json” -d ‘{“file”:{“filename”:“image.png”, “contents”:“iVBORw0KGgoAAAANSUhEUgAAAusAAADqCAYAAAAbOguxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBG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tHY/S+2+fOnlXqD/232GmpICAACAz7BeJrAdU50d2IpnpgMAAGAiv2u3clxFvh0EaAAAACQZ1iX/XwQ0pVppXMoDAAAAHAzrm4i34Y7dCAAAgJTDehNpYI/1cwMAAABHh3Vp93jC2NzJzzeNAgAAAKbDeq24ng/eiOeZAwAAYCZhXdqtrteRfPZzsaoOAACAGYX1xoVg67bicY0AAACYWViXdl+SZPn69SqSCQUAAADgPaxL0lo2n7LSiMtfAAAAMPOwLheKLQX2RtIr8QVIAAAAIKybCuwEdQAAABDWHwjsIa9hryQ9I6gDAACAsH7YWruV7Xriz3ct6YW4Rh0AAACE9UeVLjhPscrevteaXQQAAADC+nEaF6CfaXctezNCSH8lrk8HAAAAeof1Vq3dtezP3J/bAZ+hlnTrXuuVC+wAAADA7P0x8Pcb7VbYN5IySYWkhaTn7u9yf29Dee3++av751LTXwcPAAAAROH/BwDSlTevI70CFQAAAABJRU5ErkJggg==”}}’

Thanks, I think we’re on the right track. If I copy the JSON array and paste it into Postman under raw, and select application/json from the pulldown, and tell my API workflow to expect a parameter named “file” to be placed into a file field in a thing, then I get an image uploaded to Amazon that displays properly in Bubble’s image element.

So far I haven’t been able to replicate that success from my desktop app. I keep getting a formatting error. First it was an unexpected token and now it’s a very specific message saying that the content for the image file is missing. That seems like a positive trend, since the server knows enough about what’s going on to give me a specific error message.

I think I got it.

The reference says to put the base64 string into “content” but the server is looking for “contents” with an “s”.

Oops you’re right, sorry about that. Will fix the reference.

For what it’s worth, I also found another way of doing things.

This post is fascinating. He’s doing some really cool stuff with javascript in an html element. One of the neat things I learned is that you can put the entire base64 content of an image into a “link”.

So something that did technically work for me was to upload the base64 into a thing’s text field with “data:image/jpg:base64,” concatenated onto the beginning. Then I put that text into an html element with this code "<img src="search for whatever:first item's text field" width="200px"/> It’s ugly and clunky and slow, but it’s an option.

2 Likes

Hokay, so, here’s what seems to be working for me:

  1. get your file (name and data)
  2. isolate and url encode the filename (somefile.jpg)
  3. base64 encode the filedata
  4. put the filename into array1[filename]
  5. put the filedata into array1[contents]
  6. put “false” into array1[private] (I haven’t tried making it private and attached to a database thing yet)
  7. put that array into array2[file] (I tried changing that but the server stopped accepting it, so apparently it has to be “file”)
  8. put anything else you need into array2[], for example “some example text” into array2[example]
  9. convert array to JSON (as required) what you end up with is something like this:
    array2={
    file={filename=file’s-name.jpg, private=false, contents=base64}
    example=some example text
    }
  10. setup your API to recognize the “file” parameter as a file and the “example” parameter as text
  11. change the headers to “Content-Type: application/json”
2 Likes

Since I’m looking at it, I noticed that the reference still says “content” when it should be “contents”

1 Like

You are best to file this with a bug_report so it doesn’t get lost in the forum or forgotten.

1 Like

What did you need to do to encode the .jpg to base64?

Same guy, I just don’t feel like switching to my primary account.

So I used Livecode, which has a command to encode the data as base 64.

After fiddling a long time with the “detect data”-function to get this to work I tried it with just adding the data format myself.
Just put the Key “file” and Type “image” by hand and it magically works.

Wondering if anyone has had luck with this since. I believe I’ve got my JSON object formatted properly, being passed to my endpoint, but the result I get in the bubble db is a blank image.

cc @iggyvanlith @emmanuel

Look correctly at the first part of your video (Emmanual Post).
The file information are store in a “file” parameter (you can call it whatever you want)
this give

{
	"file": {
		"filename": "filename.jpg",
		"contents": "base64 encoded data"
	}
}
1 Like

Thanks @Jici, I’ve tried with that exact format as well (with the file JSON object, then filename and contents stored in that object) but no luck. Just retested and I’m still getting this as the record in the DB.

What did you set for the initialize setting of “file”?

1 Like

@Jici thanks for the help here – here’s the initialize call (1st image) and the api workflow detect data result for the endpoint I’m trying to set up


should the “contents” data be set as a file as I’m doing?

1 Like

I forget. But if you use autodetect, the file is split in two part. You can save contents to field (just set image or field) but you need to save the name in another field.
I test it with
data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2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xw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==
without any problem.

Now if you want to save it to s3, I recommend to manually encode the api data. It should save to s3 this way with the filename.

@Jici or others - how does one save the base64 as a file? My original assumption was that the file contents were going to be saved to S3 and referencing that as the source of the the image I create.

When creating the Image record (like first image) I’m still getting it as a Base64 filetype (second image)


Dear blueback09, could you please advice how to do this : 10. setup your API to recognize the “file” parameter as a file and the “example” parameter as text

Thanks in advance

@kirill_anikin my impression of that was

  1. In Api Workflows, you can either use ‘Detect Request Data’ or ‘Manual definition’
    https://cl.ly/9794b3fa5ea1
  2. Initialize the endpoint, which will show you the parameters you’re passing into it (ie via a POST endpoint)
    https://cl.ly/c5d5c71988da
  3. Define how you want to use the data you’re passing to the endpoint (ie as File if desired)
    https://cl.ly/357019d358ac