cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Convert image to base64

SOLVED
Amethyst

Convert image to base64

How can I convert a image (media entry) to an base64 code?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Convert image to base64

I solved it. I create a function with return type BLOB and this line:

 

var result = MediaEntities[image].GetImage();
3 REPLIES 3

Re: Convert image to base64

You can look into using the snippet:

var encodedValue = base64EncodeBytes(undefined /* not ready for baseType of "JSON" yet*/);

Re: Convert image to base64

I know this function but i believe its not work with MediaEntities.

 

EDIT: Maybe I need a step that convert the image to an byte array

Re: Convert image to base64

I solved it. I create a function with return type BLOB and this line:

 

var result = MediaEntities[image].GetImage();