Nadeem Mehta (NadeemM8116)
Lead Consultant
NadeemM8116 Member since 2018 5 posts
Posted: October 3, 2019
Last activity: October 3, 2019
Posted: 3 Oct 2019 13:40 EDT
Last activity: 3 Oct 2019 15:12 EDT

File downloaded with 0 bytes

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 TIFF content stream from FileNet P8. This content stream is stored in a Text property on clipboard (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, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.