Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url = 'file:///c/temp/file.xlsx';
- var xhr = new XMLHttpRequest();
- xhr.open("get", url, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4 && xhr.status == 200) {
- var blob = new Blob([xhr.response], {
- type: "octet/stream"
- });
- var reader = new window.FileReader();
- reader.readAsDataURL(blob);
- reader.onloadend = function () {
- base64data = reader.result;
- console.log(base64data);
- }
- }
- }
- xhr.responseType = "arraybuffer";
- xhr.send();
Add Comment
Please, Sign In to add comment