📁

Read Data from IFormFile

TechnologyC#
Editor of the PageLatif Bahadır ALTUN
IFormFile formFile = (Request.Form.Files.Count > 0) ? Request.Form.Files[0] : null;
StringBuilder result = new StringBuilder();
using(var reader = new StreamReader(formFile.OpenReadStream()))
{
    while(reader.Peek() >= 0)
    {
        result.AppendLine(reader.ReadLine());
    }
}