Convert binary to Base64

0
Hi, We are using camera widget to capture an image and save it. Our server expects the image to be in Base64 format. But in ​mendix, we are getting it in binary format. We don't know a way to convert it to Base64. Is there a way to achieve this?   Thanks
asked
1 answers
1

Hi Manish,

The camera widget is storing the image in basically in the System.FileDocument which is indeed a binary. To get the content as Base64 string you should use the java action 'Base64EncodeFile' from the CommunityCommons appstore module. The input is a System.FileDocument (you're image object) and returns a Base64 string which you can use for you server.

Good luck!

answered