2011年12月7日

使用 IE 下載 Office 2007 檔案(docx/pptx/xlsx)變成 zip

正確解法:

apache 請修改/etc/mine.type

application/vnd.openxmlformats    docx pptx xlsx

另外解法1:

及使用.htaccess檔
application/vnd.openxmlformats docx pptx xlsx

另外解法2:
修改httpd.conf 加入以下字串
AddType application/vnd.openxmlformats .docx .pptx .xlsx
 
iis 請新增mine 以下三個:

pptx
application/vnd.openxmlformats-officedocument.presentationml.presentation
docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document
xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


最後到網路找了一下資料.才知道在IIS6.0要下載office 2007格式的檔案

要先到IIS管理員→網站→右鍵[內容]→HTTP標頭→MIME類型→新增→

副檔名:.docx
MIME類型:application/vnd.openxmlformats-officedocument.wordprocessingml.document

這樣就可以下載.docx檔了...

更多Office2007文件的MIME格式如下:

.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template

隨機好文:
Powered by Stuff-a-Blog

Share/Save/Bookmark

0 意見: