Question
Cooperatieve Rabobank U.A
IN
Last activity: 5 Apr 2023 7:22 EDT
Preview the file content(Pdf,docx,img) received from the external source.
Invoked the external source for the file stream which could be of different types(Pdf,docx,img).
While the below code is used to work fine for pdf type alone(preview).
While other type of files are downloaded to local drive, unable to preview it.
byte[] encoded = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(stream);
HashStringMap aMap = new HashStringMap();
aMap.put("ContentDisposition",ContentDisposition);
aMap.put("contentType",contentType);
PublicAPI tools = null;
PRThread thisThread = (PRThread)ThreadContainer.get();
tools = thisThread.getPublicAPI();
try{
tools.sendFile(encoded,FileName,false,null,false);
// return true;
}
catch(Exception ee){
//return false;
}
Do we have any option to preview files type like .doc / img /jpeg?
Note: No attachment are created in the case flow from the received file stream.