Hakan Ozbay
Hakan Ozbay

Reputation: 4719

Save Base64 String as an Excel .xls file using JavaScript in IE 7

I have been trying to find a way to save a Base64 String in IE 7 using JavaScript as a Excel .xls file. The following works fine with FireFox:

window.open ("data:application/vnd.ms-excel;base64," + bytestring, "", "width=300,height=300,resizable=1");

where bytestring is the Base64 string. This method however does not work for IE 7.

Having done some internet research, it seems that IE 7 can't seem to handle dealing with Base64 Strings. How would I be able to achieve this? Would I have to use convert Base64 to UTF to be able to do this?

What I am trying to achieve is when the user clicks a button, the 'save as' dialog appears, allowing the user to give a filename and select destination, and then saving the Excel file.

I am limited to using IE 7. Believe me, if I had a choice to use a different browser, I definitely would.

Thanks in advance for any help!

Upvotes: 4

Views: 3997

Answers (1)

mystery
mystery

Reputation: 19513

This isn't possible in IE7, without a server-side proxy. Either do that, or output an HTML table and ask the user to copy and paste it into Excel.

Upvotes: 1

Related Questions