title: Write large file to HTTP response
body: <p>I am currently developing an asp application with c# .net. I have to query a large(10GB) SQLite database and write the data as CSV format to HTTP response.
  I am doing this</p>
  
  <pre><code>        /*query database, use string builder to create a csv*/
          Response.ContentType = "text/plain";
          Response.AddHeader("Content-Length", result.Length.ToString());
          Response.AddHeader("Content-Disposition", "attachment; filename=\"Data.csv\"");
          Response.Write(result);
          Response.Flush();
  </code></pre>
  
  <p>Which works file with small amount of data. But when the file size increases I get a OutOfMemoryException. I think using StringBuilder to create a string is causing the issue. I can not figure out any way to solve the issue. Can anyone please help me resolve this?</p>