I've seen application/csv
used and also text/csv
.
Is there a difference? Does it matter which as long as the request matches something that's available? Are they interchangeable?
CSV files can be used with most any spreadsheet program, such as Microsoft Excel or Google Spreadsheets. They differ from other spreadsheet file types because you can only have a single sheet in a file, they can not save cell, column, or row. Also, you cannot not save formulas in this format.
Use "application/octet-stream" for the "All files (*)" filter, since that is the base MIME type for all files.
Common use cases for exporting CSV files Some programs will give you the option of CSV or PDF such as Gusto's custom report builder, but when it comes to spreadsheet data, just a CSV export is the most common.
There is an RFC which covers it and says to use text/csv
.
This RFC updates RFC 4180.
Recently I discovered an explicit mimetype for Excel application/vnd.ms-excel. It was registered with IANA in '96. Note the concerns raised about being at the mercy of the sender and having your machine violated.
Media Type: application/vnd.ms-excel
Name Microsoft Excel (tm)
Required parameters: None
Optional parameters: name
Encoding considerations: base64 preferred
Security considerations: As with most application types this data is intended for interpretation by a program that understands the data on the recipient's system. Recipients need to understand that they are at the "mercy" of the sender, when receiving this type of data, since data will be executed on their system, and the security of their machines can be violated.
OID { org-id ms-files(4) ms-excel (3) }
Object type spreadsheet
Comments This Media Type/OID is used to identify Microsoft Excel generically (i.e., independent of version, subtype, or platform format).
I wasn't aware that vendor extensions were allowed. Check out this answer to find out more - thanks starbeamrainbowlabs for the reference.
You should use "text/csv" according to RFC 4180.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With