Rank 2: Process
Hi. I'm trying to make a function which get image on 3rd party service and send it back to the user in base64 string. And issue seems like base64 string brakes response object. Appwrite runs locally on MacOS.
My functions return response:
res.json({ success: true, imageBase64: 'base-64-string'});
client side handler:
if (execution.statusCode !== 500) {
console.log('response ::: ', execution.response.image)
setImageData(execution.response.image);
}
and console log output is:
{"success":true,"image":"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAaGVYSWZNTQAqAAAACAACknwAAgAAACkAAAAmkoYAAgAAABgAAABQAAAAAE9wZW5BSS0tZjE4ZWQ5NzYxYjE2NW... Show more (1Mb) Copy
and can not be parsed. On client side I used React.js if it matters.
In case return object doesn't contain so long string as base65 image it parsed fine and I can get access to values by key in JS.
Any suggestion will be really appreciated.