Quantcast
Channel: Active questions tagged filereader - Stack Overflow
Viewing all articles
Browse latest Browse all 107

Upload an excel file to backend in the form of binary data(using readAsArrayBuffer) in Javascript/Angular

$
0
0

I have to upload and read an excel file from UI and send the file data in binary form to a backend API.

I am using the File reader and reading the file as binary, like below, and passing the fileReader.result to my Node js controller for calling the API.

fileReader.readAsBinaryString(this.file);

At the backend this is throwing some error.When I am using fileReader.readAsArrayBuffer(this.file) ; I am not able to pass to the controller, since this is object, not a string.

How do I resolve this issue, I want to pass the data obtained from readAsArrayBuffer to the API.


Viewing all articles
Browse latest Browse all 107

Trending Articles