javascript - “File couldn't be downloaded” in Internet Explorer V 11 with ASP.NET MVC -


i have mvc site run iis on server. need open excel file code javascript or return file controller. but, code run if run site on ie9.however, if run site on ie11 following error : microsoft cannot access file http://...// ... there several possible reasons:the file name or path not exist. file being used program.

i sure file exist in correct path. , error if run on ie11, not on ie9.

in addition, if run code local on ie11 can open file , not error.

i error in site on ie 11 browser.

code open file :

javascript :

window.location = document.getelementbyid("elementname").innerhtml + "?path=" + $('#eleexcelpaht').html() + "#divopenfile" 

controller:

public fileresult openfile(string path) {   fileinfo filetoopen = new fileinfo(path);    return file(path, mimemapping.getmimemapping(path)); } 

this action in controller return file javascript.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -