I've found a way to create a text file then instantly download it in the browser without writing it to the server in regular ASP.net:
The accepted answer uses:
using (StreamWriter writer = new StreamWriter(Response.OutputStream, Encoding.UTF8)) {
writer.Write("This is the content");
}
I need to do this in ASP.net Core 2.1 MVC - though in that doesn't know what Response.OutputStream is - and I can't find anything on Google to help with that, or other ways to do this.
How can I do this? Thanks.