-
New Feature
-
Resolution: Fixed
-
Major
-
2.4.3, 2.9
-
MOODLE_24_STABLE, MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
MDL-42616-master -
-
BACKEND Sprint 19
-
Medium
Updated This issue now refers to a custom tool that lets administrators add new file types. You can define the MIME type and text description, and select an icon from the existing Moodle file type icon set.
The below is the original description from the problem we were experiencing (when it misdiagnosed a file as a zip file):
A fairly frequent occurrence is that certain courses will use files of a specific, obscure format intended for a particular software program. Often these formats are based on standard formats. Students are expected to download the files (and the software, either free software or commercial software that's been licensed for them) and then open the files in the software.
Moodle makes this difficult because it automatically identifies generic file types, incorrectly. The worst offender is zip. I'm not sure if it also does the same for XML.
This then causes problems for students because when they download the files, depending on the browser (a) they may get renamed to the zip extension, and (b) it also offers to open them in an unzip program. Both these things cause problems for students, who are generally not technically skilled. Even if renaming a file isn't a challenge, we still have to tell them to do it, and they're going to be asking the obvious question, why on earth are you making us download files with the wrong name and then renaming them...
Here is an example of the type of issue request I get:
<<
The three GeoGebra files on this page [...] are displayed as .zip files when they should be .ggb files. When I downloaded the files they saved as .ggb files, but when Zoe tried this they saved as .zip files that couldn't be used.
The files are displaying correctly on the 12J presentation website [...]. Has something changed in the VLE updates that now causes the files to be associated with Winzip?
This is pretty urgent as the students need to use these files now.
>>
I don't think we should add a complete list of obscure random MIME types and icons (GeoGebra? Come on) to Moodle core. However, Moodle really needs to stop breaking these file downloads.
I can do temp fix for this kind of problems by running a database query like the following:
<<
update mdl_files set mimetype='document/unknown' where filename like '%.ggb' and mimetype != 'document/unknown'
>>
But obviously I have to do that each time this is reported and if they upload any more files they will be screwed again. And it will only ever be reported when students are actually due to be using the files at that moment, so it always turns into an urgent request...
To be honest I'm not sure what the right solution is here, but I can see two good possibilities:
1. Stop the auto-detection logic for common container formats (.zip, .xml), so that only files called .zip get the zip mimetype and others get a suitable unknown type mimetype.
or
2. Make it easy to add user-configured MIME types in the admin user interface (this is roughly MDL-7101 - yay four-digit issue). Since I'd like this to happen in stable branches, I suggest this could be a minimal implementation using a single text area where you enter a list of types in a basic text format, similar to mime.types but also including the format description and which icon to use.
I am very happy to work on this, with the proviso that I'd like to do a minimal implementation which is easy to implement and backport rather than a fancy GUI - fancy GUI could be left for later work if required.
Before I do anything, could I get opinions on this - what's the best approach? To me it sounds like adding the mime configuration would be better but...
- has a non-specific relationship to
-
MDL-82859 core_filetypes::core_filetypes() assumes that any type of file will only have a single mime type
- Closed
- has been marked as being related by
-
MDL-35622 Internet Explorer 9 problems with smartboard files.
- Closed
-
MDL-49466 Policy: What to do about new mimetype requests
- Closed
- is duplicated by
-
MDL-7101 Admin interface for custom mime types
- Closed
- will help resolve
-
MDL-47468 Add MimeType for Mathematica (.cdf .nb)
- Closed