I'm working with asp.net core webapi and I want to post an excel file from client (using Angular 2) to my Controller. I've read Import Excel example but what they've done is use an existing file. I want to know how can I read an excel file using IO.Stream. Thanks for your help. I've started read a .txt file like this:
public string Post()
{
var files = Request.Form.Files;
if(files != null)
{
var stream = files[0].OpenReadStream();
StreamReader reader = new StreamReader(stream);
string result = reader.ReadToEnd();
int a;
return result;
}
return "";
}