title: Send a csv (saved in the solution) to the front end using C# MVC
body: <p>I'm new to C# and I'm building a web scraper with a front end using MVC. The application uploads a file of IDs, uses selenium to lookup the uploaded IDs, collects data, then writes it to a CSV. The CSV is then saved within the solution with the file path "./files/output.csv".</p>
  
  <p>The functionality works all the way to writing and saving the output.csv to the solution. <strong>But I can't figure out how to send that CSV back to the user on the front end.</strong> After "./files/output.csv" is written, the controller hits a line that says</p>
  
  <pre><code>return Ok(new { count = files.Count, size, filePath });
  </code></pre>
  
  <p>and a simple line of JSON appears on the screen giving count/size/filepath of the uploaded file(s).</p>
  
  <p>Here is my controller</p>
  
  <pre><code>public class ScraperController : Controller
  {
      private readonly IScraperService _scraperService;
  
      public ScraperController(IScraperService scraperService)
      {
          _scraperService = scraperService;
      }
  
      [HttpPost("Scraper")]
      public async Task&lt;IActionResult&gt; Post(List&lt;IFormFile&gt; files)
      {
          long size = files.Sum(f =&gt; f.Length);
  
          var filePath = Path.GetTempFileName();
  
          foreach (var formFile in files)
          {
              if (formFile.Length &gt; 0)
              {
                  using (var stream = new FileStream(filePath, FileMode.Create))
                  {
                      await formFile.CopyToAsync(stream);
                  }
                  List&lt;string&gt; memberIds = _scraperService.Read(filePath);
                  List&lt;Result&gt; results = _scraperService.Scrape(memberIds);
                  _scraperService.Write(results);
              }
          }
  
          return Ok(new { count = files.Count, size, filePath });
      }
  
      public IActionResult Index()
      {
          return View();
      }
  </code></pre>
  
  <p><strong>How do I send the newly written .csv back to the user?</strong> Do I need another ActionResult? Do I need another controller? Do I need another view?</p>