Click to See Complete Forum and Search --> : Is your docx file turning into a zip? - SOLUTION


discorax
10-05-2007, 12:33 PM
In an attempt to save someone some heartache, I'm going to write up about a problem that I've seen, but hasn't been well documented. The new Office 2007 file extensions (docx,potx,xlsx,etc) turning into ZIP files when they are uploaded to a web server and then downloaded.

The new Office 2007 file formats are now using an Open XML file format (http://msdn2.microsoft.com/en-us/library/aa338205.aspx) system so they are more compatible with other office programs from Google, Open Office...etc. Essentially they are ZIP files that are full of XML files that when opened with the a proper application turn into a friendly word document. While that's pretty nice of Microsoft, they haven't been to good about release MIME type information for these file formats which can cause some interesting issues when trying to upload and download them to a webserver.

I stumbled onto this problem while I was working with MediaWiki (www.mediawiki.org). I was uploading Office 2007 files (docx to be precise) and when my co-workers went to download them on Vista, they would save as .zip files. When they tried to open them up they were just a bunch of XML files which to the untrained eye would be a bunch of gobbledygook.

I was tasked with solving this problem. After searching the internet for a good 2 hours I stumbled onto a post on a DRUPAL (www.drupal.org) blog. Someone was asking about this problem using Drupal. So I thought, what do Drupal and MediaWiki have in common...php/mysql backend was what I came up with.

So after doing some more research I found a blog post written by Dave Overton (http://uksbsguy.com/blogs/doverton/archive/2007/03/13/how-to-get-companyweb-windows-sharepoint-services-v2-to-work-with-office-2007.aspx). He was trying to solve that same problem for a local SBS server. He found a solution that involved the MIME Types on the server. The lightbulb went off.

Since Office 2007 is new and Vista is new a web server isn't going to know what application runs what file extension. At some point Microsoft will release an update (I hope) but until them we can just add in the appropriate MIME Types to our web servers and that should give us the results we want.

I put up the list of office 2007 file extensions and their MIME Types on to the server hosting my MediaWiki and just like that everything worked. Here is the list of Office 2007 MIME type associations you can add if you run into this same problem.


".manifest", "application/manifest"
".xaml", "application/xaml+xml",
".application", "application/x-ms-application",
".deploy", "application/octet-stream"
".xbap", "application/x-ms-xbap"

".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"
".potm","application/vnd.ms-powerpoint.template.macroEnabled.12"
".potx","application/vnd.openxmlformats-officedocument.presentationml.template"
".ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"
".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"
".xlam","application/vnd.ms-excel.addin.macroEnabled.12"
".xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"
".xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"
".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
".xltm","application/vnd.ms-excel.template.macroEnabled.12"
".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"

mcupples
06-13-2008, 10:46 AM
So yeah, to make this work in apache, throw up a file called .htaccess in the web root of whatever site you want to change and throw this crap in it:

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

and it'll work. thanks to the op! been looking for that for a while!

ontrac
06-17-2008, 03:53 PM
Hi,

I am pretty new to this and am using Drupal. We uploaded a .xlsm file and when someone tries opening it, it opens in ZiP and the content is not what we uploaded.

I tried what was suggested however the .htaccess file already exists in the root.

What do you recommend? Should I append the existing file?

I actually tried that and restarted Apache but no-go...

thoughts?

mcupples
06-17-2008, 04:06 PM
not sure what could be the issue then - post your .htaccess file here and we'll take a look?

what version of apache are you using?

ontrac
06-18-2008, 06:46 AM
Thank you,
Keep in mind, all I did was add to the file what was recommended (see below)


#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on

# If your site can be accessed both with and without the prefix www. you
# can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. prefix, adapt
# and uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
#RewriteBase /drupal

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>


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




".manifest", "application/manifest"
".xaml", "application/xaml+xml",
".application", "application/x-ms-application",
".deploy", "application/octet-stream"
".xbap", "application/x-ms-xbap"

".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"
".potm","application/vnd.ms-powerpoint.template.macroEnabled.12"
".potx","application/vnd.openxmlformats-officedocument.presentationml.template"
".ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"
".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"
".xlam","application/vnd.ms-excel.addin.macroEnabled.12"
".xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"
".xlsm","application vnd.ms-excel.sheet.macroEnabled.12"
".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
".xltm","application/vnd.ms-excel.template.macroEnabled.12"
".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"




# $Id: .htaccess,v 1.81 2007/01/09 09:27:10 dries Exp $

mcupples
06-18-2008, 09:44 AM
haha, awesome dude. awesome.

take out all the stuff in quotes at the bottom there starting with

".manifest", "application/manifest"

and ending with

".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"

All that stuff was from the op in some kinda crazy format for some other web server that I'm too stupid to understand, my post was what you needed for Apache. All that garbage you put in there Apache has no idea what to do with.

Try that out and lemme know how it goes.

ontrac
06-18-2008, 10:06 AM
i removed the extra stuff and restarted the server but that did not do it.

I added this script (not mine) and placed it: Apache Group\Apache2\conf\update_mime.vbs

and that seemed to have dome something however instead of downloading the .xlsm file as 07 it opens as 03.

Any other thoughts?


'This script adds the necessary Office 2007 MIME types to an IIS Server.
'To use this script, just double-click or execute it from a command line.
'Running this script multiple times results in multiple entries in the IIS MimeMap.

Dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
Const ADS_PROPERTY_UPDATE = 2

'Set the MIME types to be added
' MimeTypesToAddArray = Array(".manifest", "application/manifest", _
' ".xaml", "application/xaml+xml", ".application", "application/x-ms-application", ".deploy", "application/octet-stream", _
' ".xbap", "application/x-ms-xbap")
MimeTypesToAddArray = Array( _
".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" , _
".potm","application/vnd.ms-powerpoint.template.macroEnabled.12" , _
".potx","application/vnd.openxmlformats-officedocument.presentationml.template" , _
".ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12" , _
".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" , _
".xlam","application/vnd.ms-excel.addin.macroEnabled.12" , _
".xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12" , _
".xlsm","application/vnd.ms-excel.sheet.macroEnabled.12" , _
".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" , _
".xltm","application/vnd.ms-excel.template.macroEnabled.12" , _
".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template" _
)

'Get the mimemap object
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")

'Call AddMimeType for every pair of extension/MIME type
For counter = 0 to UBound(MimeTypesToAddArray) Step 2
AddMimeType MimeTypesToAddArray(counter), MimeTypesToAddArray(counter+1)
Next

'Create a Shell object
Set WshShell = CreateObject("WScript.Shell")

'Stop and Start the IIS Service
Set oExec = WshShell.Exec("net stop w3svc")
Do While oExec.Status = 0
WScript.Sleep 100
Loop

Set oExec = WshShell.Exec("net start w3svc")
Do While oExec.Status = 0
WScript.Sleep 100
Loop

Set oExec = Nothing

'Report status to user
WScript.Echo "SharePoint Mime Types have been added."

'AddMimeType Sub
Sub AddMimeType (Ext, MType)

'Get the mappings from the MimeMap property.
MimeMapArray = MimeMapObj.GetEx("MimeMap")

' Add a new mapping.
i = UBound(MimeMapArray) + 1
Redim Preserve MimeMapArray(i)
Set MimeMapArray(i) = CreateObject("MimeMap")
MimeMapArray(i).Extension = Ext
MimeMapArray(i).MimeType = MType
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
MimeMapObj.SetInfo
End Sub

redrings
08-08-2008, 05:25 PM
Hey, thanks for this. Worked perfectly - office 2007 files are now downloading correctly.

dillibabur
10-26-2008, 12:45 AM
Hi ,

I am facing the same issue (office 2007 files are opened as zip files while downloaded). I am using Pramati 4.1 server. I do not see .htaccess in the server. Can you please help me how to fix this issue in Pramati.

Thanks
Babu

paul_796
11-24-2008, 10:02 AM
I have half users using Mozilla with no problem but those using IE have the issue, I haven't seen any patch from Microsoft as a patch yet, but isn't this really an IE issue?

DustDevil1980
05-13-2009, 11:54 PM
For apache2:

/etc/mime.types

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

Chenille
06-21-2009, 05:27 AM
Thanks for this discussion. Now I am able to solved the problem. Great job.


Simulation pret (http://simulationpretimmobilier.net)

sam111986
08-27-2009, 06:27 AM
Hi, I have IIS 5.1 installed on my computer with windows xp pro (sp2). I use Coldfusion MX.
I have added the mime types to my IIS.
I've also added these mime types to the metabase.bin.
However, when i access my website (with IE7 )on localhost the problem still remains.
The office 2007 files are stll being downloaded as .zip files.
Any sugestions ???

gershie
01-05-2010, 08:21 PM
Thanks DustDevil1980! This worked like a charm.
etc/apache2/mime.type though, but once I found it I simply copied it in.

dsavals
01-30-2010, 09:08 AM
This did it for me, thanks a lot mcupples, opened the folder my Excel file was in then went to file manager, created new file paste it the code you recommended, done.

Thanks

notaprogrammer
02-02-2010, 12:07 PM
I've been having the same problem with .docx files attached to emails and being saved as un-openable zip files. I am absolutely not computer-savvy. I use IE8 and Windows 7. Please explain this fix in a way I could follow - or suggest a site that would have it. This would save a lot of grief. thanks very much

Sachin Sharma
02-03-2010, 07:51 AM
Hi Sam,
i am facing the same problem in CFML. i am able to upload office 2007 file but for download when i click on hyperlink in IE it opens a zip file with lots of xml files. i thing i noticed is that when i mouse over the link it shows file name with proper extension (docx or xlsx).

is your problem resolved? plz let me know if u hav any idea?

-Sachin

Kasmar
02-09-2010, 02:08 PM
Just had a customer with this problem of not being able to download .xlsx and .pptx files from webmail the correct way. They were downloading as .zip. He was able to download .docx though. Tested his web account on my computer and it worked for me to download his attachments from his email.

So since it did not seem to be a server problem in this situation I tried to find the differences on the computers. He was running IE8 and I was running IE7 both on Windows XP.

After uninstalling the IE8 upgrade from his computer he was able to download the attachments the right way.

philsou
02-19-2010, 06:14 PM
I have been experiencing the same issue when downloading docx files with Internet Explorer and getting zip files.
Does anyone know if there is an article from Microsoft documenting this issue or if they are going to fix it?

Thanks!

BCsolutions
02-20-2010, 09:58 AM
Line 1 in the code should be?
AddType application/vnd.ms-word.document.macroEnabled.12 docm
with no . in front of the file extension name
This code also worked for me...Thank you very much!

So yeah, to make this work in apache, throw up a file called .htaccess in the web root of whatever site you want to change and throw this crap in it:

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

and it'll work. thanks to the op! been looking for that for a while!

bradclif
03-05-2010, 08:58 AM
For apache2:

/etc/mime.types

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

For Apache2.2 users still having issues after adding the mime types listed above, read on.

We're running Apache2.2 on Windows Server 2003. Most users are using IE v6+. The IE users were having the same problems with a new .pptx file.

When I checked conf/mime.types, the mime types were already in the file. However, I saw that the "application/vnd.ms-powerpoint" entry only contained the ppt, pps, and pot extensions. Adding the pptx extension fixed the problem.

To avoid future problems with other Office file types, I modified the following conf/mime.types entries as follows:


application/msword doc docx dot dotx
application/vnd.ms-excel xls xlsx xlm xla xlc xlt xltx xlw
application/vnd.ms-powerpoint ppt pptx pps ppsx pot potx potx sldx

alleybj
03-19-2010, 06:26 PM
if you save the docx document as a zip file and then change the extension from .zip to .docx it magically turns it into a word document; to change the file extension, you have to go into control panel and folder options and uncheck the box that says hide extensions

ugwings
05-21-2010, 10:30 AM
Thanks for the tip, this was very helpful. By the way I placed these apache mime types directly in the mime.types file for Apache config and worked just as well (Removed the add statement word at the front).:)

whitegrim
06-07-2010, 08:06 PM
I am new to programming and having somewhat similar problem. I am using Opencart ecommerce for selling documents. However, there is a problem. When customer purchases documents which can be doc, docx, ppt, pptx, xls, xlsx, zip, rar etc. The problem is that whenever they are clicked to download "application/octet-stream" pops up to save whether it is doc or docx or even zip!!! However this issue is only with Mozilla as everything works fine in Chrome and IE. Anyone can help me here!!!

vishwanat_rr
06-16-2010, 06:09 AM
Hi there

I have mentioned the mime type in my apache under /etc/mime.types
still it did not work as expected

Interestingly it works in some of the IE8 browsers but not all

Does the order matters in /etc/mime.types ?

And IE8 with windows 7 OS, the docx opens with type as XML ..

Any suggestions

n03
11-05-2010, 06:42 PM
I had this problem, my aplication was made on java and the web server was jetty, but i think that with this solution it doent mater about the web server, the only thing that you hava to do is add this lines on your web.xml :


<mime-mapping>
<extension>docx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mime-type>
</mime-mapping>

<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>

I hope this help us, because i was searching for this solution.

shaamesamander
12-03-2010, 11:15 AM
Thanks mcupples. This worked for me on Oracle Application Server.

juliev
01-27-2011, 05:43 PM
THANKS to Discorax and MCupples for starting and adding to this post. It was great to find a solution to such a weird problem.

wgchapel
01-31-2012, 08:26 PM
Thanks Bradclif et al. That worked a charm! :):):)