Question

2
Replies
323
Views
Close popover
Gopalakrishna Mudda (GopalakrishnaM0540)
Infosys Ltd

Infosys Ltd
IN
GopalakrishnaM0540 Member since 2018 1 post
Infosys Ltd
Posted: September 18, 2018
Last activity: September 18, 2018
Closed

Need to auto download the file without the options Open and Save file

Hi, I am able to download the file but my requirement is to download the file with out asking any option 'Open' or 'Save' file should auto download.

Below code is working for auto download but when user try to save the same, File name showing some thread name(having issue only in IE).

Expected: TextFile.pdf

Currently: !@3e7785c9ca4843f7ca63cc5f3e9ed8c7!OpenPortal

com.pega.pegarules.pub.util.Base64Util base = new com.pega.pegarules.pub.util.Base64Util();
String LTRFileName = tools.getParamValue("FileName");
String EDGSContent = tools.getParamValue("EDGSBinaryContent");

LTRFileName = LTRFileName+".pdf";

HashStringMap aMap = new HashStringMap();
aMap.put( "ContentDisposition", "inline; filename="+LTRFileName+";");

byte[] printData = base.decode(EDGSContent.getBytes());
String sErrorMessage1 = tools.sendFile(printData, LTRFileName, false,aMap, false);

Please suggest me to acheive my requirement.

Thanks,

Gopal

Already referred these posts:

Unable to open/download the PDF file by clicking the button again and again

How to show a PDF stream after generating it (no case to attach)?

Case Management User Experience
Moderation Team has archived post,
Close popover 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.