Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8382

Internet Explorer truncates Zip files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Major Major
    • None
    • 1.6.4, 1.7.1
    • Resource
    • None
    • Internet Explorer on Windows XP. Reproduced on Apache/2.0.59 (Win32) PHP/5.1.6

      When users try to download a Zip file from Moodle using Internet Explorer, the file is truncated. WinZip and Windows XP's internal zip-processing algorithms both complain that the file is corrupted. Please see the following course to reproduce the error:

      http://elearning.lse.ac.uk/moodle-1.7/mod/resource/index.php?id=2

      Log in as a guest. The enrolment key is 'testkey'. Try to download "test.zip", which should be 7,397 bytes. The size after downloading from IE is 7,334 bytes. I can reproduce the error using IE6 SP2 (6.0.2900.2180.xpsp_sp2_gdr_050301-1519) and IE 7.

      A workaround exists, where the teacher can add "?forcedownload=true" after the filename. This is not ideal: we don't really want to be reminding our users to do this every time they upload a zip.

      I have created a patch for lib/filelib.php which will set $forcedownload to true if the mimetype is 'application/zip'. It fixes the problem, and I haven't seen any adverse effects on other browsers. Please find it attached, and let me know if you find anything wrong.

      Chris

            skodak Petr Skoda
            chrisf Chris Fryer
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.