Question

I have a string containing Excel XML Spreadsheet data that I want the users to be able to download as an .xls-file. I'm currently using the below code, which works fine in Chrome. However, since the majority of our users are still on IE8 we will have to run the page through Chrome Frame and here the download doesn't seem to work (nothing happens).

We also have a warning on page unload/leave reminding users to save before closing, so downloads that trigger this event (like location.href = blob) won't work. - This does not apply anymore, though location.href does not work anyway.

var blob = new Blob([template]),
    saveLink = document.createElement("a");            

saveLink.href = window.URL.createObjectURL(blob);
saveLink.download = "EventDetails.xls";
saveLink.click();

EDIT:

I have also tried the following without any success:

window.open("data:application/vnd.ms-excel," + template, "_self");

And,

var blob = new Blob([template], { type: "application/vnd.ms-excel" });
window.open(window.URL.createObjectURL(blob), "_self");

I guess the problem is that Chrome Frame are using IE8's downloader and therefor opens up a new session which cannot reach the data?

Was it helpful?

Solution

I doubt this will ever be fixed, since further development of Chrome Frame will stop in January 2014 (See blog) and there are no longer anyone signed to the ticket for this problem. So I'm closing the question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top