I am using the following function for downloading an attachment file, as binary data, inside an Office 365 app:
var saveByteArray = function (data, name) {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var blob = new Blob(data, { type: "octet/stream" }),
url = window.URL.createObjectURL(blob);
a.href = url;
a.download = name;
a.click();
window.URL.revokeObjectURL(url);
};
It works successfully in Chrome browser, but following error has occurred, when I open it through the Outlook desktop client:
Error TypeError: Assignment to read-only properties is not allowed in strict mode
The error happens, when executing this line:
access a.style = "display: none";
Is there any alternative solution for this implementation ?