20110216 microsoft xml archive filetypes pptx and other matters - plembo/onemoretech GitHub Wiki

title: Microsoft xml archive filetypes (.pptx) and other matters link: https://onemoretech.wordpress.com/2011/02/16/microsoft-xml-archive-filetypes-pptx-and-other-matters/ author: lembobro description: post_id: 66 created: 2011/02/16 14:12:27 created_gmt: 2011/02/16 14:12:27 comment_status: open post_name: microsoft-xml-archive-filetypes-pptx-and-other-matters status: publish post_type: post

Microsoft xml archive filetypes (.pptx) and other matters

My content people were having problems with some .pptx files (Microsoft Powerpoint files that use archived (zipped) xml to bundle binary data like media files with presentations) they had put out there for download. Instead of giving the user a choice of downloading or saving the browser kept trying to do an unzip on them. The solution was to add some new document types to /etc/mime.types on the Red Hat Enterprise Linux (RHEL) web server that was hosting their pages.

Basically the fix was pretty simple: just append the following lines to /etc/mime.types on the host and reload Apache.

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

You’ll notice that some of these are for other Microsoft Office applications, like Word and Excel. I added them as well because it’s only a matter of time before we start seeing a slew of .docx and .xslx files getting posted.

Had a similar problem with some .hol files they’d put up there. These were Microsoft Outlook “holiday” files, really just specially formatted text files that can be imported into Outlook to add holidays to a calendar. Issue here was that the web server thought they were binary files, specifically some kind of multimedia audio file. Turns out that at the dawn of the computer era the .HOL extension was used for Commodore Amiga music files. How Apache 2.2 is aware of this would probably be an interesting story (it’s not in the system mime.types). It’s possible the file extension association is embedded someplace in an operating system or web server library. In any event, my solution was to add the following to the system /etc/mime.types:

application/vnd.ms-outlook hol

and then reloaded Apache. It worked.

Helpful hints over at Server Fault, webdeveloper.com and on OTN. In the last frolovalexander pointed out that these types should also get the AddType treatment in httpd.conf for the web server because /etc/mime.types might be overwritten by a system package update. To which I say, “that’s why you need to put your system configurations in cvs!”

UPDATE (2013/10/15): The following is a complete list of openxml related file types in the latest /etc/mime.types shipping with Fedora 19:

application/vnd.openxmlformats-officedocument.custom-properties+xml
application/vnd.openxmlformats-officedocument.customXmlProperties+xml
application/vnd.openxmlformats-officedocument.drawing+xml
application/vnd.openxmlformats-officedocument.drawingml.chart+xml
application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml
application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml
application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml
application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml
application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml
application/vnd.openxmlformats-officedocument.extended-properties+xml
application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml
application/vnd.openxmlformats-officedocument.presentationml.comments+xml
application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml
application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml
application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
application/vnd.openxmlformats-officedocument.presentationml.presProps+xml
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml
application/vnd.openxmlformats-officedocument.presentationml.slide      sldx
application/vnd.openxmlformats-officedocument.presentationml.slide+xml
application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml
application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml
application/vnd.openxmlformats-officedocument.presentationml.slideshow  ppsx
application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml
application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml
application/vnd.openxmlformats-officedocument.presentationml.tags+xml
application/vnd.openxmlformats-officedocument.presentationml.template   potx
application/vnd.openxmlformats-officedocument.presentationml.template.main+xml
application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml
application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml

Copyright 2004-2019 Phil Lembo