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

Internet Explorer truncates Zip files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a bug
    • Affects Version/s: 1.6.4, 1.7.1
    • Fix Version/s: None
    • Component/s: Resource
    • Labels:
      None
    • Environment:
      Internet Explorer on Windows XP. Reproduced on Apache/2.0.59 (Win32) PHP/5.1.6

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              chrisf Chris Fryer
              Tester:
              Nobody Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: