Commit a2921150 authored by Ilker Kulgu's avatar Ilker Kulgu

IE & Edge fix for downloading blob files, gives option to save or open the...

IE & Edge fix for downloading blob files, gives option to save or open the file when the link is opened.
parent ebe1eca3
......@@ -90,7 +90,13 @@ function spawnWebsocket(pa) {
var pbd = $('#pbd');
pbd.attr('class', 'center-align');
// IE & Edge fix for downloading blob files, gives option to save or open the file when the link is opened.
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
var fileName = escapeHtml(data.name);
window.navigator.msSaveOrOpenBlob(blob, fileName);
} else {
var blobURL = URL.createObjectURL(blob);
}
var innerHTML = ['<p><a href="', blobURL, '" class="btn btn-primary" download="', escapeHtml(data.name), '">', i18n.download, '</a></p>'];
if (data.type.match(/^image\//) !== null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment