Close popover
Nadeem Mehta (NadeemM8116)

NadeemM8116 Member since 2018 5 posts
Posted: October 3, 2019
Last activity: October 3, 2019

How to show TIFF Binary Stream

I am working on a PoC and need to show contents of a TIFF file downloaded from FileNet. I need help in figuring out why the downloaded file is empty.

I have a soap connector that retrieves content stream from FileNet P8 server. This content stream is stored in a Text property on clipboard (for now in pyWorkPage) along with file name and mime type. I pass these values to parameters and retrieve them in Java code.

Below is the Java code that I am using.

String cS = tools.getParamValue("contentStream");

String cID = tools.getParamValue("caseID");

String filePath = pega.getStaticContentUtils().getServiceExportRoot();

String fN = tools.getParamValue("fileName") + "." + tools.getParamValue("mimeType");

String explicitTmpDir = tools.getSystemSettings().getFSSetting("initialization/explicittempdir", "" , true, false);

String PathDir= explicitTmpDir +"/StaticContent/global/ServiceExport/";

try {

byte[] byteArray = cS.getBytes(); FileName = new; // create file fileOuputStream = new;

fileOuputStream.write(byteArray); // write data into file

fileOuputStream.close(); // close file

pega_rules_default.downloadFile(FileName, tools, true); // download file and delete afterwards

} catch(Exception e) {

oLog.error("TestStream exception in Java step: " + e);


The code doesn't throw any error or exception but opens an empty file. If I choose to save file on my local drive, it shows a 0 byte file.

Image removed.

And here is some debug information.

Image removed.

Any help will be greatly appreciated.

Data Integration Java and Activities
Moderation Team has archived post