Uploading an image of a canvas to cloudinary

Start here: Curl - HTML/CSS to Image

I’m trying to see if I can get it working, too.

1 Like

Thanks!

The difficulty arises from the fact that URL should not exceed 64K bytes and the Base64 you are creating is much longer this leads to the URL to fail.

1 Like

I’ll have a look at this tomorrow, and tell you the result. It’s getting late.

1 Like

@muneer Yes, you’re right.

@codeswept I’ve never gotten a POST command to work in Thunkable but I know it’s possible.

Here’s the code I’m trying:

image

But it requires authentication that I haven’t gotten quite right in Thunkable.

I also tried this in Postman using a curl command but the API server returned a 414 Request-URI Too Large error so I think I have to give up on this method.

1 Like

It looks like both of these APIs accept Base64 as input. Have you tried either?

https://ocr.space/ocrapi

1 Like

Interesting!
Last night I had a dream of a Curl Command chasing after me with a knife😖

I hoped that the second link offered GET calls but

1 Like


When I test it on my laptop, I get ‘try on a device’. When I try it on my tab, nothing turns up.

1 Like

I think you need to put generate JSON from object before image of Canvas1 to have it as Base64 sting of the image

1 Like

Let me try that.

After ‘set qp’ I don’t get anything in my input.

1 Like

Should I put the Image of Canvas1 block in the header or as a Query Parameter?

1 Like

I have to check the documents of the API itself. I took a quick look on one of the examples in Postman and the only parameter in the header in the API key.

However, from what I know, both header and query part should not be long and you want a Base64 that is over 100K in size so you need to consider having it in the body part of the API.

1 Like

If I put it in the body part, then it doesn’t accept the CREATE OBJECT block. Do I directly use the ‘generate json’ block?

1 Like

Yes, Yes

1 Like

Cool, thanks! Trying that

1 Like

I got a ‘network request failed’ again.

for the body part of the API. all engines expect text so even if you need to code it as an object in thunkable then you need to proceed that with generage JSON from object

1 Like

I have done that.

1 Like

No. It should be Base64image parameter of the body.

You will need to use the create object to do that.

1 Like