excel文件的内容类型是什么? [重复]
本文翻译自:What is correct content-type for excel files? [duplicate]
This question already has an answer here: 这个问题在这里已有答案:
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文件在点击时在Excel中打开,不会保存在桌面上,或者在浏览器中嵌入打开等等。现在显然这一切都取决于每个用户的所有配置,但最好的内容类型是什么和其他设置,以实现大部分时间?
#1楼
参考:https://stackoom.com/question/CKAT/excel文件的内容类型是什么-重复
#2楼
请记住,当您尝试上载已打开的文件时, file.getContentType
也可以输出application / octet-stream而不是所需的application / vnd.openxmlformats-officedocument.spreadsheetml.sheet 。
#3楼
application/vnd.ms-excel
-
vnd class
/ vendor specificvnd class
/供应商特定 - http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats
#4楼
For BIFF .xls files 对于BIFF .xls文件
application/vnd.ms-excel
For Excel2007 and above .xlsx files 对于Excel2007及更高版本的.xlsx文件
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet