You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/12/07 08:53:49 UTC
[GitHub] [royale-asjs] asifashfaq commented on issue #971: mx:DownloadButton Test Case Working Issue
asifashfaq commented on issue #971:
URL: https://github.com/apache/royale-asjs/issues/971#issuecomment-739774048
yes. it is not working for for binary array type of data.
when we assign byte type array then an array buffer is created. that buffer can't be passed directly to the blob.
so first we have to convert that buffer in required format.
mx.net.FileReference.prototype.save = function(data, defaultFileName) {
var byteArray = new Uint8Array(data.ba);
defaultFileName = typeof defaultFileName !== 'undefined' ? defaultFileName : null;
var /** @type {HTMLAnchorElement} */ a = window.document.createElement("a");
a.href = window.URL.createObjectURL(new Blob([byteArray],{ type: 'application/octet-stream' }));
a.setAttribute("download", defaultFileName);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
};
that is working fine for me.
DownloadButton need to be upgraded.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org