Question

16
Replies
2777
Views
Close popover
Abikash Kumar Sharma (AbikashSharma)
Cognizant

Cognizant
SE
AbikashSharma Member since 2014 15 posts
Cognizant
Posted: March 15, 2018
Last activity: January 19, 2021
Solved

Download working only once

I want to download a simple text document on click of a button in PRPC7.3.1. On click of the button I refreshed the section and called an activity that has just one java step. The java content is given below. On first click of the button, the document is downloading properly but thereafter its not throwing to browser. I traced, all the steps are executing properly. If I refresh the complete URL from browser, it again works fine for one time only.

ClipboardPage objHeadersPage = tools.findPage("pxRequestor").getProperty(".pyHTTPResponseHeaders").getPageValue();
objHeadersPage.putString("contentType" ,"text/plain");
objHeadersPage.putString("ContentDisposition" ,"attachment;filename=test.txt");
String contents="Hello World!!";
byte[] bContents=contents.getBytes();
String result=tools.sendFile(bContents,"test1.bat", false, null, true);

Data Integration Java and Activities