You need to sign in to do that
Don't have an account?
sujin h s
How to convert base64(blob) into image and saving it in apex?
Hi all,
My requirement: I have to select some part(for eg: a table in my component) of my component and save it as image.
I'm able to retrive the pixel data(base64 or blob) using Canvas & converting it into image(jpg) in apex and sending it as mail using
efa.contenttype='image/jpg';
Blob body = Encodingutil.base64Decode(data.substring(data.indexOf(',') + 1));
I'm successfully able to do it.
But I want to convert it as image/jpg and saving it local file OR to salesforce folders so that i can download the image.
Can anyone help with code?
Thanks! in advance
My requirement: I have to select some part(for eg: a table in my component) of my component and save it as image.
I'm able to retrive the pixel data(base64 or blob) using Canvas & converting it into image(jpg) in apex and sending it as mail using
efa.contenttype='image/jpg';
Blob body = Encodingutil.base64Decode(data.substring(data.indexOf(',') + 1));
I'm successfully able to do it.
But I want to convert it as image/jpg and saving it local file OR to salesforce folders so that i can download the image.
Can anyone help with code?
Thanks! in advance
Assuming you have tried to use same Blob body in creating Attachment/Document and saving it in salesforce.
Thanks.