Opened 14 years ago
Closed 12 years ago
#17117 closed defect (bug) (fixed)
WordPress serves up wrong MIME type for Office 2007 downloads
Reported by: | LafayetteNuke | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Media | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
When serving up hosted files for download, WordPress assigns the wrong MIME type for Office 2007. For example, docx files are served up as "application/msword" instead of "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
As a result, browsers end up interpreting the files in different ways. Some, like IE8 on Windows 7 or Safari on Mac OS X 10.6, will add a ".doc" to the end of the file name. Others (Firefox, Chrome) will see the Office 98-2003 MIME type, but keep the existing file name. The iPad displays a "Unknown file type" error. The issue is not limited to Word 2007 files however; all Office 2007 files (pptx, xlsx) appear to have the same issue.
There is a forum discussion for this issue:
http://wordpress.org/support/topic/docx-files-and-functionsphp?replies=9
It's possible this bug was introduced here:
http://core.trac.wordpress.org/changeset/9662
The proposed change is to tweak the MIME declarations in wp-includes/functions.php to reflect the proper MIME type information.
Attachments (5)
Change History (18)
#3
@
14 years ago
@dd32
added updated version (hopefully with correct naming). sorry didn't noticed that the name wasn't included.
#7
follow-up:
↓ 8
@
13 years ago
I see 'sld' added in wp_ext2type() but missing from get_allowed_mime_types().
#8
in reply to:
↑ 7
@
13 years ago
Replying to nacin:
I see 'sld' added in wp_ext2type() but missing from get_allowed_mime_types().
I guess it should be 'sldm'. Fixed in 17117.2.patch. Whitespace changes are for better alignment.
#11
@
12 years ago
Merged with the patch from #15735 (some rearragements and comments for easier reading).
Patch looks valid, however, it'd be appreciated if when creating patches, you either use svn diff, or include the full filename in the path of the diff.
This should only be affecting Multisite, as only multisite installs serve files through the File handler (Single sites serve static files directly, and any mime type issues are a server configuration issue)