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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Convert image to base64

drichter
14-Alexandrite

Convert image to base64

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

1 ACCEPTED SOLUTION

Accepted Solutions
drichter
14-Alexandrite
(To:drichter)

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

 

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

View solution in original post

3 REPLIES 3
PaiChung
22-Sapphire I
(To:drichter)

You can look into using the snippet:

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

drichter
14-Alexandrite
(To:PaiChung)

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

drichter
14-Alexandrite
(To:drichter)

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

 

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