Missing mime types

Bug #1193158 reported by awillson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Invalid
Medium
Robert Lyon

Bug Description

There are critical mime types missing for support of docx, pptx, xlsx files.
I believe this may work:

Add the following to htdocs/artefact/file/filetypes.xml

<filetype>
        <description>docx</description>
        <mimetypes>
            <mimetype>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mimetype>
        </mimetypes>
    </filetype>
    <filetype>
        <description>pptx</description>
        <mimetypes>
            <mimetype>application/vnd.openxmlformats-officedocument.presentationml.presentation</mimetype>
        </mimetypes>
    </filetype>
    <filetype>
        <description>xlsx</description>
        <mimetypes>
            <mimetype>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mimetype>
        </mimetypes>
    </filetype>

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Which version of Mahara are you using? We can't replicate this on master (1.8-to-be) and demo.mahara.org (1.7) for example.

Can you also please provide which version of Apache you are using?

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

And also the browser and its version?

Mahara relies a lot on browser and web server identification of the mimetypes of files. Thus, this issue seems to have been fixed in later versions of these.

Revision history for this message
awillson (awillson) wrote : Re: [Bug 1193158] Re: Missing mime types

All versions of Mahara to date are missing these mime types in the
filetypes.xml definition file.

The problem of docx, pptx, xlsx files relates to other bugs noted in
other areas. The basic browser issue is with IE8. While IE8 is not new
and will be replaced with other browsers in the future, it is very
widespread currently. Also, if there is a mime definition of doc and
ppt already present, there shouldn't much burden in adding the few lines
to define internally docx, pptx, xlsx as well.

The mime problem is mostly on the upload side. When a user on IE8
uploads a docx file, Mahara [all versions], store it as a zip file along
with its constituent xml components. This is a serious issue for many
using older Microsoft client computers configured with IE8. Also, since
the file was uploaded as a zip file, the downloaded mime type is now
wired as a zip file via the incorrect storage. So, if I download the
file on another system via any browser [tested with FF, Chrome] the mime
defaults to zip...

I traced the problem of Mahara storage to filetypes.xml --- it's
probably much better to define these very common mime types internally
so as to ensure compatibility and interoperability with browsers that
may be finicky but also much used...

Please note: The latest stable code does not contain fixed mime types.

-----Original Message-----
From: Kristina Hoeppner <email address hidden>
To: andrew.willson@1024bits.com
Subject: [Bug 1193158] Re: Missing mime types
Date: Thu, 20 Jun 2013 23:55:39 -0000

And also the browser and its version?

Mahara relies a lot on browser and web server identification of the
mimetypes of files. Thus, this issue seems to have been fixed in later
versions of these.

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Andrew,

Have added you patch

Plus included the missing vnd.ms-excel one
https://reviews.mahara.org/#/c/2282/

Aaron Wells (u-aaronw)
Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Robert Lyon (rlyon)
milestone: none → 1.8.0rc1
Revision history for this message
Aaron Wells (u-aaronw) wrote :

The patch is in gerrit, it has passed code review, the only thing left is to test it. So how do I test this? What's the expected behavior, and what is it doing instead?

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Well, I don't have a copy of IE8 on hand to test this with right now, but I was able to replicate the error in IE6 as follows:

1. Get a Word document with the .docx file extension. (I've attached one to this comment).

2. In IE6, go to the Content -> Files page in Mahara. Upload the docx file there.

Expected result: It should show up with the generic "file" icon next to it and be treated like a normal binary file.

Actual result: It shows up with the "Zip" icon, and has an "unzip" option available.

The patch supplied didn't fix this problem for IE6. BUT, it doesn't claim to, it's supposed to fix the problem for IE8. So, once I can get a copy of IE8 to test this out on (or if someone else wants to test the patch), we should be able to upstream it.

Revision history for this message
awillson (awillson) wrote :

I did several iterations of testing to try to fix the IE "zip" problem.
Nothing seemed to work properly. Eventually I discovered that the "zip"
download issue is prevalent throughout all Microsoft products. The
problem seems to be that IE ignores the mime type supplied by the web
server [apache, but also IIS], and the mime type of docx, pptx, etc are
incorrectly assigned in the registry.

There are a few MS forum pages on this issue. The official MS response
is that the mime types should be assigned correctly by the web server,
of course IIS. And then there are several user posts indicating that
the mime types are set correctly at the server with no effect. And then
other users indicating that docx is actually a zip file - which is true
- so the mime type is working correctly even though a docx should open
with Word and be saved with a docx extension. And around we go...

In short, this doesn't seem to be a Mahara problem at all, and it is NOT
FIXABLE since IE is incorrectly "sniffing" the mime type. I apologize
for not updating the bug report to indicate my findings, and I truly
appreciate the efforts in hunting down the stated problem. It is
unfortunate that the installation of Mahara I administer is used by
client machines with older Microsoft software. Thank you again very
much for replicating the problem, and attempting to correct the reported
"bug". However, there's not much that I or the Mahara team can do about
this particular issue.

--Andrew

-----Original Message-----
From: Aaron Wells <email address hidden>
To: andrew.willson@1024bits.com
Subject: [Bug 1193158] Re: Missing mime types
Date: Thu, 22 Aug 2013 07:44:46 -0000

Well, I don't have a copy of IE8 on hand to test this with right now,
but I was able to replicate the error in IE6 as follows:

1. Get a Word document with the .docx file extension. (I've attached one
to this comment).

2. In IE6, go to the Content -> Files page in Mahara. Upload the docx
file there.

Expected result: It should show up with the generic "file" icon next to
it and be treated like a normal binary file.

Actual result: It shows up with the "Zip" icon, and has an "unzip"
option available.

The patch supplied didn't fix this problem for IE6. BUT, it doesn't
claim to, it's supposed to fix the problem for IE8. So, once I can get a
copy of IE8 to test this out on (or if someone else wants to test the
patch), we should be able to upstream it.

** Attachment added: "A .docx file for testing"
   https://bugs.launchpad.net/mahara/+bug/1193158/+attachment/3782044/+files/Test.docx

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Thanks Andrew,

In that case, I'll go ahead and mark this bug "Invalid", since it's apparently not something we can fix.

Cheers,
Aaron

Changed in mahara:
status: In Progress → Invalid
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.