I am using
using (StreamWriter writer = new StreamWriter(Response.OutputStream, System.Text.Encoding.UTF8));
In order to directly write some lines of text and send them to the browser as an attachment.
I now though also want to save that text locally in a file, but Id rather avoid changing too much of my code. Can I write the contents of Response.OutputStream
into a text file before ending the response?