Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Open File (Office) Not Working in IE 11 Metro Mode

$
0
0

I have an app that downloads files when a user clicks a link.  The
browser navigates to a page with a querystring that tell the app which
file to read.

Here is the relevant code:

 FileStream fs = File.OpenRead(path);
                    var buffer = new byte[fs.Length];
                    fs.Read(buffer, 0, (int)fs.Length);
                    fs.Close();

                    // Response.AddHeader("Content-Disposition", "inline; filename=" + fi.Name)
                    SetResponseHeaders(buffer, fi);

                    Response.BinaryWrite(buffer);
                    Response.Flush();
                    Response.End();

Very easy and straightforward - it's worked for years and with all
the popular browsers.  Until now... because it doesn't work in IE
11 Metro (or what they like to call "Modern").  I'll call it IE11M. The
OS is Windows 8.1.

When I run in IE11M, IE asks to Open, Save or Cancel.  If the user
clicks Save, it behaves as expected. If the user clicks Open, the
appropriate Office program opens, but the file never really loads. For
example, PPTX files show only 1 empty page in the left or the UI. Word
actually tried to render my login page! (I have a feeling that this is a
clue that somehow session is being lost between Metro and Desktop.)

Any ideas about this would be appreciated. 

One thing I could do is detect if the browser is running in Metro
Mode and call Response.AddHeader("X-Download-Options","noopen");

Thanks in advance! Please let me know if I left out some info from this question that would be helpful.



Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>