Below is the code handled, to open file link in the browser. Here when I try to load the file link in the MS Edge browser.the file is not opening when I click on the link from MS Edge browser .this is working for InternetExplorer need to handle in code for MS Edge also.
try {
var workbook = new jQuery.ig.excel.Workbook(jQuery.ig.excel.WorkbookFormat.excel2007);
var l_ddlTarget = jQuery("#ddlTarget").igCombo("value");
jQuery.ajax({
url: baseURL + '/MarginalImpact/ExportCTRMData/',
type: "post",
async: true,
dataType: "json",
data: {
argTarget: l_ddlTarget,
},
error: function (errorThrown) {
alert(jQuery(errorThrown.responseText).filter('title').text());
},
success: function (result) {
jQuery("#myModalExport").modal('hide');
var l_FilePath = result;
if (l_FilePath != null && l_FilePath != "")
l_FilePath = l_FilePath.replace(/\\\\/g, '\\');
jQuery("#lbExport").attr("href", "file:///" + l_FilePath);
jQuery("#lbExport").text(l_FilePath);
jQuery("#fakeloader-main").addClass("black-screen");
jQuery(".ui-dialog-titlebar-close").css("background-color", "#e8e8e8!important");;
jQuery("a").css("background-color", "#e8e8e8!important");
try {
jQuery("#dialogFilterSectionMI").igDialog("destroy");
}
catch (e)
{ }
jQuery("#dialogFilterSectionMI").igDialog(
{
modal: true,
headerText: "Click on below link to open the file",
draggable: false,
resizable: false,
height: "200px",
width: "600px",
modal: true,
draggable: false,
resizable: false,
showCloseButton: true,
});
jQuery(".ui-igdialog-close-icon").css("background-color", "#c2c2c2");
Opening files / folders via file:/// from a webpage protocoll is no longer supported in modern browsers (Edge, Chrome, etc.) due to security reasons.
For some use cases MS edge has introduced a new protocoll (viewinfileexplorer) that for opening files via webDAV, but not sure if this helps you https://docs.microsoft.com/en-us/deployedge/microsoft-edge-policies#configureviewinfileexplorer