Question

4
Replies
551
Views
CHOUGALB Member since 2007 4 posts
Incessant Technologies
Posted: 1 year ago
Last activity: 1 year 8 months ago
Closed

Provide a document downloadable link/direct download option for documents stored in Amazon S3 webstorage

We have a requirement to provide a downloadable link for the attachments uploaded in the work objects. Downloadable link needs to be provided as a REST service response which is exposed by Pega. As documents are stored in Amazon S3 there is no direct download link to documents without logging into pega. Below is the sample document location:

file://pegacloudfilestorage:/attachments/sample_CNR-10074.pdf

Also tried the direct download option by using sendFile() api but this works when service executed from Pega standalone. When we call the service from postman/SOAP UI, document download pop-up appears but there is no content and documents are getting corrupted.

Used below java in service activity to Service activity is

try
{
String fileSpec = myStepPage.getString("spec");
PRFile remoteFile = new PRFile(fileSpec);
tools.sendFile( remoteFile, false, null, true );
}
catch ( Exception e ) {
throw new PRRuntimeException(e);
}
Requesting inputs if anyone has come across this requirement.
Thanks,
Bharatesh
Pega Platform Cloud Services
Moderation Team has archived post
Share this page LinkedIn