Error in reactJS using drop-zone to receive files and replace them with byte buffers
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
onDrop = async (file) => {
try {
console.log(file.name);
let reader = new window.FileReader();
reader.readAsArrayBuffer(file); // <<== Error occurred here
const buffer = await Buffer.from(reader.result);
console.log(buffer.length);
} catch (error) {
console.log(error);
}
how can i fix this .. please help