This is usually based on the file extension of the file being downloaded. But it can be over ridden by pushing the desired content header, such as:
header('Content-Type: application/octet-stream')
You can also use a header to push the file name that you want to offer them to save the download file as. This is particularly handy if you're using a php file to push formatted text out of a database. Unfortunately this doesn't work with all browsers, but it works with enough to attempt to use.
header('Content-Disposition: attachment;filename="filname.csv"');