What is correct content-type for excel files?
ExcelMime TypesExcel Problem Overview
I want excel files on a website to open in Excel when clicked, not get saved on desktop, or get opened embedded in a browser etc. Now obviously it all depends on how everything is configured for each user, but what's the best Content-Type and other settings to achieve just that most of the time?
Excel Solutions
Solution 1 - Excel
For BIFF
application/vnd.ms-excel
For Excel2007 and above .xlsx files
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Solution 2 - Excel
application/vnd.ms-excel
-
vnd class
/ vendor specific
Solution 3 - Excel
Do keep in mind that the file.getContentType
could also output application/octet-stream instead of the required application/vnd.openxmlformats-officedocument.spreadsheetml.sheet when you try to upload the file that is already open.