Skip to content

Instantly share code, notes, and snippets.

@isc30 isc30/download_binary.js

Last active Aug 26, 2018
What would you like to do?
downloading binary data as a file
function download_binary(binaryData, fileName, mime)
file = new Blob([binaryData], { type: mime });
downloadUrl = URL.createObjectURL(file);
// download the Blob
anchor = document.createElement('a'); = fileName;
anchor.href = downloadUrl;
anchor.dataset.downloadurl = mime + ":" + fileName + ":" + downloadUrl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.