Response Content type as CSV Response Content type as CSV asp.net asp.net

Response Content type as CSV


Using text/csv is the most appropriate type.

You should also consider adding a Content-Disposition header to the response. Often a text/csv will be loaded by a Internet Explorer directly into a hosted instance of Excel. This may or may not be a desirable result.

Response.AddHeader("Content-Disposition", "attachment;filename=myfilename.csv");

The above will cause a file "Save as" dialog to appear which may be what you intend.


MIME type of the CSV is text/csv according to RFC 4180.


Use text/csv as the content type.