How to convert Octet Stream to Base64 format
We need to use the base64 byte array in sendFile Pega method to convert it to a file. But, We are not able to convert the octet stream to base64 byte array format. We tried with the below function, but we got error like "We don't support this file format"
Function for Converting Octet source data into base64: byte[] tempBytes = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(tools.findPage("DocDownloadTempPage").getString("pyFileSource"));
Function for SendFile: tools.sendFile(tempBytes,"IMAGES.JPG",false,null,true);
Kindly suggest any other alternative approach