This is the code snippet that I want to make Blob before Base64 :
This part of the comment works, and when the URL generated with this parameter is set to img src, it displays the image:
var blob = items[i].getAsFile(); //var URLObj = window.URL || window.webkitURL; //var source = URLObj.createObjectURL(blob); //console.log("image source=" + source); var reader = new FileReader(); reader.onload = function(event){ console.log(event.target.result) }; // data url! var source = reader.readAsBinaryString(blob);
The problem with the lower code, the generated source variable is null
Update:
Is there an easier way to do this using jQuery to be able to create a Base64 String from a blob file, as in the above code?
javascript jquery
xybrek Sep 06 '13 at 4:55 on 2013-09-06 04:55
source share