Skip to Content
0
May 30, 2018 at 06:43 AM

sapui5 how to open a file in new tab(not new window) which is available in binary format

2577 Views

Im getting data from back-end service in binary format. Im able to convert the data into readable format by using atob() method in javascript. Now i want to open the data in a new tab.Using the below code im able to download the data.


var data="JVBERi0xLjMNCiXi48/TDQolUlNUWFBERjMgUGFyYW1ldGVyczogQUJEUFJTVFhiaA0KJURldnR5cGUgSFBMSklJSUQgRm9udCBDT1VSSUVSICBib2xkIDEyMCBMYW5nIEVOIFNjcmlwdDogIDAgLT4vQzAwMQ0KMyAwIG9iag0K"

var bin=atob(data);

sap.ui.core.util.File.save(bin,"filename","pdf","application/pdf");



But i dont want to download the data. I just want to display the data in a new tab. Can someone please help me to fix this requirement.