. Marko Lampret » Problem: XLSX in DOCX datoteke shranjuje kot .zip
06.12.
2011

Kako rešiti problem, ko se .docx in .xlsx datoteke (iz Microsoft Office 2007 ali 2010) shranjujejo kot .zip datoteke, ko jih poskušamo prenesti s spletne strani na svoj računalnik?

Omenjena težava se pojavlja le v Internet Explorerju pri neprepoznavanju MIME tipov zaradi nepravilne konfiguracije strežnika. Na mojem strežniku teče Apache spletni strežnik in ker imam dostop do .htaccess datoteke, sem problem rešil s pomočjo AddType ukaza. V korenskem imeniku spletne strani je treba v .htaccess dodati sledeče vrstice:

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

(več: http://httpd.apache.org/docs/current/mod/mod_mime.html)

Še za tiste, ki ste na MS Windows strežnikih – v kolikor uporabljate IIS, v datoteko C:\pot_do_windows\system32\inetsrv\MetaBase.xml vpišite sledečo kodo

.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

(Več: http://technet.microsoft.com/en-us/library/bb742440.aspx#EEAA)

Po vpisu teh ukazov lahko v Internet Explorerju s strežnika prenašate datoteke zbirke Ms Office 2007 oz. 2010 in vam jih ne bo shranjevalo kot .zip datoteke. Kljub temu priporočam uporabo drugega brskalnika (Firefox, Safari, Chrome, Opera, … ).

Ni komentarjev.

Dodaj komentar