I want to read a CSV file as binary format to send to an API.
I use the following HTML input - file
<input type="file" name=filedata (change)="fileChangeEvent($event)" />
fileChangeEvent(e)
{
var fileData, file = e.target.files[0], reader = new FileReader();
if (!file) {
return;
}
reader.onload = function(e) {
};
reader.readAsBinaryString(file);
}
But, I am getting the following error
ERROR TypeError: Object doesn't support property or method 'readAsBinaryString'