Skip to main content
1-Visitor
February 3, 2021
Question

How to convert Thingworx Image Datatype to String

  • February 3, 2021
  • 3 replies
  • 1533 views

How to convert Thingworx Image Datatype to String in thingworx Services

3 replies

16-Pearl
February 3, 2021

Hello @Partha 

 

Please refer following community post ,if it is what you are trying to achieve

https://community.ptc.com/t5/ThingWorx-Developers/Convert-image-to-base64/td-p/557667

 

In case you have further concern, please feel free to revert and share the your use case .

 

Thanks

Om Dukiya

14-Alexandrite
February 11, 2021

Hi @Partha 

 

Can you also give a try to below code to convert Image DataType to String:

 

var img = me.ImageProp; //When you have defined a property of Type Image

 

or

 

var img = MediaEntities["img"].GetImage(); //simply get the image name of pre-defined MediaEntity
var result = base64EncodeString(img); //Define Output type as String

 

Support
February 18, 2021

Hi @Partha.

 

If your feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon