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

Set Operations Using Bash Commands

Found a great post over at good coders code, great reuse. This…

Simple Guide To Signing RPMs with FPM

I’ve been using the excellent fpm (Effing package manager!) tool for automatically…

Prompt to confirm copy even with cp -f?

Wow – I get so frustrated when I try to copy some…

Outlook 2003 or 2007 Won’t Save Hosted Exchange Password

For many people using hosted Exchange services, password saving problems could plague…