Spartan Java

Setup your web server to properly serve MS Office 2007 files

by on Oct.20, 2008, under Tips, Web related

Most web servers are missing the new MIME types needed for Office 2007 files (docx, xslx, etc.) and when you server one of this files from your web application the users browser typically tries to open them as ZIP files.

To fix it just add the needed MIME types to your web server:

  • 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
  • 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
  • xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12
  • xlsm application/vnd.ms-excel.sheet.macroEnabled.12
  • xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • xps application/vnd.ms-xpsdocument

For example, in Apache Tomcat you need to edit the conf/web.xml file and add the needed mime-mappings.

:, , , ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...