dimanche 8 février 2015

XLSX and DOCX files being downloaded as ZIP files in Internet Explorer

I have an applicaction in php mounted in Apache where I show a list with .xlsx and .doc files to download, In Firefox and G Chrome download correctly, but in IE downloads them as zip.


I configure the .htaccess in my /var/www/mysite/.htaccess with:



AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx


in the /etc/mime.types:



application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx


(and more)


in the /etc/apache2/sites-enabled/mysite.conf



Alias /DH /var/www/DH
<Directory "/var/www/privado">
Options Includes
AllowOverride All
Order Deny,Allow
Allow from all
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
</Directory>


but when I restart the apache server says:


Output of config test was:



AH00526: Syntax error on line 7 of /etc/apache2/sites-enabled/dh.conf:
Invalid command 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.


Thanks in advance





Aucun commentaire:

Enregistrer un commentaire