Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is correct content-type for excel files? [duplicate]

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?

like image 288
taw Avatar asked May 30 '10 03:05

taw


People also ask

What is the difference between an XLS and XLSX file?

The File Format DifferenceData is arranged in an XLS file as binary streams in the form of a compound file as described in [MS-XLS]. In contrast, an XLSX file is based on Office Open XML format that stores data in compressed XML files in ZIP format.

Can an Excel sheet be duplicated?

In Excel for the web, you can duplicate (or copy) worksheets within the current workbook. Simply right-click the tab name at the bottom of the sheet and click Duplicate. Note: You may receive an error when you are trying to duplicate a worksheet that contains a chart, picture, or shape.

How do you save a duplicate copy of an Excel file?

Select File > Save As > Download a Copy. If Excel asks whether to open or save the workbook, select Save. Note: If you select Open instead of Save, the workbook will open in Protected View.


2 Answers

For BIFF .xls files

application/vnd.ms-excel 

For Excel2007 and above .xlsx files

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 
like image 82
Mark Baker Avatar answered Oct 14 '22 05:10

Mark Baker


application/vnd.ms-excel 
  • vnd class / vendor specific
  • http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats
like image 38
miku Avatar answered Oct 14 '22 04:10

miku