I have a webpage that retrieves information from a database, converts it to .csv format, and writes the file to HTTPResponse.
string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv);
This works great and the file is sent to the client without any problems. However, when the file is sent to the client, the name of the current page is used, and not a friendlier name (for example, "data.csv").

My question is, how can I change the name of the file that is written to the output stream without writing the file to disk and redirecting the client to the file URL?
EDIT: Thanks for the answers to the guys. I received 4 identical answers, so I chose only the first as the answer.
Kyle trauberman
source share