On occasion, you'd like a cgi script to send data back in CSV format. This is often used for downloading reports, or database dumps for importing to a spreadsheet or other database.
You need to set the content header appropriately, so the browser will handle the file correctly: