asp.net mvc - ASP:NET MVC: return file : internet explorer 11 new tab? -


ie9, chrome , firefox can open new tab code bellow, ie11 force download instead of open new tab.

byte[] filebytes = system.io.file.readallbytes(contentdetailinfo.contentfilepath); response.appendheader("content-disposition", "inline; filename=" + contentdetailinfo.contentfilename); return file(filebytes, contentdetailinfo.contentfilemimetype); 

try

response.addheader("content-disposition", "attachment;filename=\"" + contentdetailinfo.contentfilename +"\"") 

more: w3.org


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -