I would like to convert a sharepoint document file to a base 64 format by using File reader. But the problem is that when I fetch the sharepoint document by Get_file (). It returns the file in sp.File object. But to use it in Filereader I need it to be either F ile object or Blob. Any help or pointers appriciated
After getting the itemd from the sharepoint document i use this code to call filereader and get a type mismatch error. I get the sharepoint Item from document library and then use this:
function(items){
for(var i = 0; i < items.get_count();i++) {
var file = items.get_item(i).get_file();
alert(file);
var reader = new FileReader();
reader.readAsDataURL(file);
//rest of my code
}
}