Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active December 14, 2017 13:27
Show Gist options
  • Save bjoerntx/9c4df39fe5234a041f219d8e131171ef to your computer and use it in GitHub Desktop.
Save bjoerntx/9c4df39fe5234a041f219d8e131171ef to your computer and use it in GitHub Desktop.
document.getElementById('file').addEventListener('change', readFile, false);
function readFile(evt) {
var files = evt.target.files;
var file = files[0];
var reader = new FileReader();
reader.onload = function (event) {
var binaryString = btoa(event.target.result);
TXTextControl.images.addInline(binaryString, -1);
}
reader.readAsBinaryString(file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment