Upload image api base64

I’m developing a merchandise conference app. The lecturer needs to take a photo of the merchandise and then at the end of the conference I need to send the image via Json base64 to an external api. Can anyone help me how to get the image and convert it to base64?

how about you try this extension? KIO4 Base64 extension

1 Like

if you found it helpful please mark it as a solution for future people

1 Like

Did you fix it?
@Mikolaj_Krajewski_Wario_S KIO4 extension did’not work for me.
When we add that base64 into json it gives 400 error. Because KIO4 adds linebreaks into Bas64 and the characters, breaks json structure rules.
So we cant send those files.

1 Like

You might use replacement blocks for \n with empty string to fix the line breaks.

Try

Taifun

It is \n
Taifun

1 Like

Thanks Taifun for notice my typing mistake.

Actually its possibly because of the length. its mmore than 64500 characters. So I should not take picture and send them directly

1 Like

Itried image picker and picked little image but having same error again. It claims that bsae 64 string breaks due to escape character. It might be too long.
Itried another ase64 tool (Filey), same error again.
Has anyone tried to send base64 string via restful API.(json reuqests)

Update: if I convert same iimages online and set those base64 string , I can easily send my requests. So sending 64 is not wrong. But all extensions that convert images to base64 are wrong.

Well… yes, sure. . All extensions do not work… of course …

what abour providing a screenshot of your relevant blocks? How large is your original image? Try a small ome…

Taifun

1 Like

Used some other extension and removed all \n occurenncies and it started working .I missed something Iguess.
Thanks all of you.

1 Like