Cloudinary API upload with upload-preset

Hi all,

I have attached the blocks I am using to upload a photo that has been either taken or chosen from the java script that I was pointed to use to create a base64 image which I then want to A) upload to cloudinary to then use with Google vision. However whatever combination I have tried to use to upload the photo I get a 400 error stating to include the upload_preset which I am doing.

I suspect that this is a formatting syntax issue but cannot find the solution any thoughts on this and I am using the drag and drop builder. I have also added my cloudinary account details under the settings of this project

Thanks

TimCS

Hello @tim.casson.smithpc
Maybe Cloudinary API doesn’t accept an image as base64.
You could try uploading the image to a backend (for example Xano), which will then upload it to Cloudinary.

Looks like Cloudinary API does support base 64 images

However, looking at the first link maybe I have to add those extra parameters for base64?

Thanks

TimCS

Hi @tim.casson.smithpc
According to the docs, the API body needs to be like this:

I’m using an unsigned upload folder so there is no signature

Also if the imsge is in a variable how does that work?

You could connect a variable on the file field

I am doing this and tried two methods

file= + [image64] +
and
file= + image64 +

If this is not the correct method please let me know also I noticed from your example you are using the generate JSON from object block - is there a reason for this? I thought it was just a string with the & separating the fields

The API body needs to be a JSON.

Oh I thought because the header is set to this Content-Type: application/x-www-form-urlencoded that it would not be in JSON format