I am encountering an issue with the code I implemented that downloads a file in Safari, but the filename appears as 'untitled'. Interestingly, it works fine in other browsers.
var saveData = (function () {
var base64 = "data:application/msword;base64,iVBOR---<some data>---JoU8gAAAAASUVORK5CYII=";
var uri = encodeURI(base64);
var anchor = document.createElement('a');
document.body.appendChild(anchor);
anchor.href = uri;
anchor.download = "hello";
anchor.click();
document.body.removeChild(anchor);
}());
saveData();
If you want to test this code, you can find it on JSFiddle. Click here for JSFiddle link