Question
1
Replies
88
Views
TATA CONSULTANCY SERVICES
Posted: July 11, 2019
Last activity: July 12, 2019
Closed
Base64 encoding in Pega 6
Hi,
We need to encode some JS variables such as var attachmentid into base 64. the function window.btoa(data) does not seem to work. could we have alternative for same in pega 6 (jdk 1.6) please ?
Hi,
<% String attachmentid="12345678" String encodedvalue=pega_rules_default.Base64Encode(attachmentid);%>
<script>
function testing(){
var jsvalue="<% =attachmentid %>";
var jsencodedvalue ="<%=encodedvalue%>";
}
</script>
converts the js variable value to base64 encoding. call the testing function and put a debugger in the code it will converts the js variable value to base64 encoding