Read Data from IFormFile
Technology | C# |
---|---|
Editor of the Page | Latif 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());
}
}