1var xhr = new XMLHttpRequest();
2 xhr.open("GET", "/path/to/local/image/file", true);
3 xhr.responseType = "blob";
4 xhr.onload = function (e) {
5 console.log(this.response);
6 var reader = new FileReader();
7 reader.onload = function(event) {
8 var res = event.target.result;
9 console.log(res)
10 }
11 var file = this.response;
12 reader.readAsDataURL(file)
13 };
14 xhr.send()