If you upload those new fancy-shmancy file formats to your web server – namely .docx, .pptx and .xlsx – and you are running Apache; chances are that your web server doesn’t know how to serve those files because they are unknown file formats. Your browser may try to download them as a .zip file (IE) or just display the binary format (Firefox) which ends up looking like jibberish with some XML data.

It’s relatively easy to fix this problem, you just need to tell apache how to handle those files.

Find the file mime.types, this may be in /etc/ or in /etc/httpd/conf/.

Add the following line to this file:

application/vnd.openxmlformats docx pptx xlsx

In one line:

echo "application/vnd.openxmlformats docx pptx xlsx" >> /etc/httpd/conf/mime.types

Restart both Apache and your web browser. Clearing the cache doesn’t work (I learned the hard way :))

Your file should now be downloaded properly to your PC.

1 comment
  1. Pingback: Dave Drager

Comments are closed.

You May Also Like

Command Line Packet Sniff Existing Running Process in Linux

Have you ever come across a server that is doing a lot…

Simple Sysadmin Trick: Using tcpdump To Sniff Web Server Traffic

Sometimes, you just have to look into the raw data to see…

Centos pip Python Install Error in pip-build-root

While attempting to install Thumbor on a CentOS server I recently had…

Apache’s mod_proxy with Exchange’s Outlook Web Access

Apache’s mod_proxy module is simply one of the best Apache modules out…