.mht Files Support

.mht Files Support

by Ewan Logue -
Number of replies: 20

We are currently using Microsoft Scorm courses for Office 2010 packages  (25 in total) in our business on the whole links and player funcitonality within these is perfect except for when the scorm looks to load a pop up to an .mht file.

i have checked the file type is in the correct location but it seems this file is not recognised by moodle i have also tried to edit the scorm howver this seems to be locked and im unable to alter it.?

can anyone advise of how to recode moodle to recognise .mht files or of a way to resolve this issue as its causing me major problems.

 

Thanks
Ewan

Average of ratings: -
In reply to Ewan Logue

Re: .mht Files Support

by Mia Musolino -

We have the same issue, but I consider this an issue with Microsoft IT Academy courses themselves. It's not just Moodle that will not open the mht files, but if you run the SCORM modules from Firefox they also will not open. I don't have a clue why MS uses mht in the modules, and I wish they wouldn't. Still, I haven't re-investigated this for a while, so if anyone else has a solution, I'd love to hear it.

In reply to Ewan Logue

Re: .mht Files Support

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Many of the MS SCORM packages are only supported by IE - some of the ones I've seen use ActiveX as well.

You can get .MHT files to open in some other browsers(If the .mht is your only issue)

http://en.wikipedia.org/wiki/MHTML#Browser_support

In reply to Dan Marsden

Re: .mht Files Support

by Matteo Scaramuccia -

Hi All,
it could be of some help to implement the right MIME Type support together with the hints provided by Dan:

diff --git a/lib/filelib.php b/lib/filelib.php
index fc69751..f5271ce 100644
--- a/lib/filelib.php
+++ b/lib/filelib.php
@@ -1516,6 +1516,9 @@ function &get_mimetypes_array() {
         'mpe'  => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
         'mpg'  => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),

+        'mht'   => array ('type'=>'multipart/related', 'icon'=>'archive'),
+        'mhtml' => array ('type'=>'multipart/related', 'icon'=>'archive'),
+
         'nbk'       => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
         'notebook'  => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),

After you've changed the code in Moodle, you need to re-publish the package to let those files take the new MIME type.

If confirmed to work as expected, please file an improvement into the Tracker.

HTH,
Matteo

In reply to Dan Marsden

Re: .mht Files Support

by Ewan Logue -

Thanks for the reply folks

As a business we use internet explorer 8 its just the .mht files that are the issues whenever you click the link within the microsoft package the popup opens and we get an error.

I've never tried changing moodle coding would anyone be able to provide  a step by step process i can follow to fix this issue and help make moodle recognise .mht as a file type?

In reply to Ewan Logue

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Ewan,
first a big disclaimer: any change should be done not in a live system but in a test/stage environment to avoid service disruption in case of any error.
That being said, if you can access directly to the server you just need to:

  1. reach someway the /lib folder of the Moodle instance
  2. create a copy of the file filelib.php, to recover any error when changing this file
  3. open the file filelib.php with a text editor
  4. got to the line number 1516, at least around the line before the first +
  5. add the 3 lines above prefixed with the +, removing the plus sign during the copy (unified diff)

Similar process if you access your server via FTP, working locally to your computer for the changes and then uploading the changed file.

Then... fingers crossed wink.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: .mht Files Support

by Ewan Logue -

Hi Matteo

I tried your suggestions and did not get any joy with it so unsure where to go next with this.

When clicking the link its pulling

pluginfile.php/2352/mod_scorm/content/1/sco1/course/media/crse10296ae_01_ss.mht

do you think i would need to make any adjustments to pluginfile.php???

any other suggests are most welcome folks or if anyone has tried this before please let me know.

i tried to load the .mht file on its own and the system is still not recognising this either.

Thanks
Ewan

In reply to Ewan Logue

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Ewan,
I'll give it a try on my dev env in the next days: applying the right MIME Type is the first step to help the OS to select the right Application for that file but maybe mht needs more attentions as per Dan's advice too.

No need to modify pluginfile.php at all, at least for now.

Matteo

In reply to Matteo Scaramuccia

Re: .mht Files Support

by Ewan Logue -

Hi Matteo

I have managed to get it working eventually took a bit of messing around but the change was:

Change - ('type'=>'multipart/related', 'icon'=>'archive'),

To -  ('type'=>'application/octet-stream', 'icon'=>'archive'),

everything works perfectly as it should and without any issues.

Thanks alot for all your help as without your input i would not have known where to start looking.

Thanks
Ewan

In reply to Ewan Logue

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Ewan,
Yes, glad to read it smile.

BTW, I'll look at this improvement selecting the best MIME Type according both to the specs and the real world, including to check that Moodle will always provide application/octet-stream as the default MIME Type for the unknown (for Moodle) extensions. I'll report back here.

Matteo

In reply to Ewan Logue

Re: .mht Files Support

by Michael E -

I'm having the same problem.

Unfortunately, this did not resolve it. I tried it with application/octet-stream, multipart/related and message/rfc822. I also added the same type to the Apache httpd.conf.

But I'm still getting the plain text and not the mht displayed.

In reply to Michael E

Re: .mht Files Support

by Mia Musolino -

nothing has worked for us, either, but we have tracked our problem to IE 9 and IE10 (they work for us in IE8). The mht files open in Firefox with UnMHT add-on installed. What version of IE are you using? If you are using Firefox, try adding the UnMHT add-on. If you are using IE8, you might try running IE in Compatibility View.

I will report back if we solve this for IE9 and 10.

In reply to Mia Musolino

Re: .mht Files Support

by Mia Musolino -

SOLVED!!!! Our admin made the changes in the rest of the postings here and I reloaded the scorm package to the course and now I can open mht files in IE9. YAY!!!!! thanks everyone!!!

Mia

In reply to Mia Musolino

Re: .mht Files Support

by Michael E -

Here's the exact fix we implemented:

 

 'mht'   => array ('type'=>'message/rfc822', 'icon'=>'archive'),
 'mhtml' => array ('type'=>'message/rfc822', 'icon'=>'archive'),

Insert that in the spot Matteo mentioned (lib/filelib.php, around line 1505 - see Matteo's post).

Republish the SCORM package by uploading the files again. Then it should work just fine. Please note that you might need a plug-in for other browsers than Internet Explorer (i.e.: Firefox).

I have filed it on the tracker: https://tracker.moodle.org/browse/MDL-38468

Thanks to everyone, especially Matteo!

 

In reply to Michael E

Re: .mht Files Support

by Mia Musolino -

great -- thanks!

Now that the mht problem is out of the way.... by any chance are your or Ewan's Microsoft Office courses IT Academy courses? If so, haave you dealt at all w/ the fact that the Exit button in the lower right corner does not work when the package is opened in Moodle? It's a javascript close window command.

In reply to Mia Musolino

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Mia,
you've that issue because of a Learning Package in Moodle runs within an iframe so that code cannot do the expected job.

You should ask/develop an improvement to let that Learning Package discover if it runs in a separated&dedicated window (i.e. the current code will work) or within a parent window to select&run the best way to close itself.

My opinion: ask to remove that button. In the real world the Content should never cross the line and enter in the LMS domain/scope.

HTH,
Matteo

In reply to Ewan Logue

Re: .mht Files Support

by Chris Dreyer -

Hi

I just received a call from a user having the same problem with a Microsoft SCORM course, as stated at the start. What seems to be odd is that besides the 157 users already done this course is only she is having this problem. I have checking it using my laptop & oofice PC, plus the fellow office users and we dont have this problem. 

It seems it's not a Moodle or platform problem but a user problem, thus what should one look for?

Regards
Chris

 

 

In reply to Chris Dreyer

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Chris,
what are the OS and IE versions? It could be due to some updates <not present>/<installed> in the affected PC as well as some IE configurations like the Moodle web site being in a different Security Zone which changes the Security Level for that site.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: .mht Files Support

by Chris Dreyer -

Hi Matteo

I working in a corporate company with a VERY strong IT support infrastructure & SW policy for users, thus about every user,  network segment etc are alligned making to a certain extent the problem hard to find for me. 75% of users are on Windows 7, Office 2010 and IE 8 which  as the Moodle administartor my pre-requisite to all users. In this case.

I have remotely (Lync) conneted to her PC and have compare about everything that I can think to both my two devices and could not find anything different. Other things been checked were Jave versions, Google bars been disabled / not installed, pop-up, etc... anddont think it is a Moodle (2.1.1+) or the MS SCorm course seeing that no other users is complaining about it.

 

Thank you for the feedback.

In reply to Chris Dreyer

Re: .mht Files Support

by Matteo Scaramuccia -

Hi Chris,
mmmhhh... I concur, really hard to find. I guess you've already try with a gpupdate /force plus a reboot to force an update of the Group Policy in case of something different in that area.

You could also try to ask her to open a mht file from her desktop to understand if the inability happens just from the web and not from the local file system.

Matteo