Hi there,
We have come across a requirement in our application that requires the Pega platform to retrieve an image from an AWS S3 bucket and display it under the data class."
Approach:
- Created a new repository (Data-Repository) instance with AWS S3 storage.
- Leveraged the OOTB data page (D_pxGetFile) to retrieve the image using the repository and file path.
- Received the content in base64 encoded format.
- Created a section rule in the data class with the following code:
<script>
var base64String = "<%= tools.getHTMLValue('PropertyName') %>";
document.getElementById('decodebase64Image').src = "data:image/jpeg;base64," + base64String;
</script>
</body>
</html>
- Rendered the section rule on the parent section.
Unfortunately, the approach did not work. Appreciate it if any insights can be shared.
Cheers,
Narendra Potnuru