Hi Friends, In this post we will see how to download a file which is in base 64 encoded format.
URL to get encoded format of a file : https://base64.guru/converter/encode/file
Selected a pdf file from my local system and click encode file to base 64 button to get encoded data of the file.
This activity use is to download the base 64 format pdf file .
For this activity we have to provide 2 parameters,
PDFName - in which name the pdf file should download
PDFDocument- base 64 format of pdf file.
Added Java step to decode base 64 into byte array.
Java code:
String S = tools.getParamValue("PDFDocument").toString();
byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(S);
tools.putParamValue("PDFDocument",byteArray);
Lets run the activity and verify our work.
We can see the pdf file is downloaded on running the verifywork activity.
Hope this topic understandable to everyone. Comment if you have any doubts.
This comment has been removed by the author.
ReplyDeletePega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download Now
Delete>>>>> Download Full
Pega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download LINK
>>>>> Download Now
Pega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download Full
>>>>> Download LINK OW
It works good. Thanks for the post. How to open base64 code as url in new window with contents alone. I don't need to download as pdf. Just i need to view as content in new tab. Could you please help me on this.?
DeleteThanks for your information. very good article.
ReplyDeleteBest Pega Online Training
Learn Pega Online
Pega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download Now
ReplyDelete>>>>> Download Full
Pega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download LINK
>>>>> Download Now
Pega Learnings: How To Base64 Pdf File By Using Pega Activity >>>>> Download Full
>>>>> Download LINK PY