{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "I have functioning code using the Ionic zip library. This code functions in all current pc browsers tested as well as many mobile browsers.\n\nIf user uses Internet Explorer with compatibility mode view enabled, the zip created will be corrupted and cannot be opened with 7zip or windows native zip utilities.\n\nDim zipTemp As New Ionic.Zip.ZipFile\n\n            For i = 0 To rayFiles.Length - 1 'loop all files marked for download\n                If rayFiles(i) <> \"\" Then\n                    'saves to server\n                    zipTemp.AddFile(strFolderPathPg & rayFiles(i).ToString, \"\")\n                    'adds db log of download file activity\n                    infoFile = ctrlFiles.GetFile(rayFiles(i).ToString, PortalId, getDbFolderPath(strFolderPathPg))\n                    infoFileLog = setFileLog(infoFile.FileId, 6, infoFileLog)\n                    ctrlFileLog.addFileLog(infoFileLog)\n                End If\n            Next\n            Response.Clear()\n            Response.BufferOutput = False\n            Response.ContentType = \"application/zip\"\n            Response.AddHeader(\"content-disposition\", \"filename=\" + strFileName)\n            zipTemp.Save(Response.OutputStream)\n            Response.End()",
    "LastUpdatedDate": "2013-12-13T12:32:30.8-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Unassigned",
      "Severity": 0,
      "Id": 0
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2013-11-25T07:52:40.217-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Internet Explorer compatibility mode corrupts downloaded zip",
    "Type": {
      "Name": "Unassigned",
      "Id": 5
    },
    "VoteCount": 1,
    "Id": 16531
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "Without knowing the particulars of what is happening with IE in compatibility mode, my guess is that you end up compressing files whose sizes are an integral multiple of DotNetZipLib's internal buffer (64K) and when that happens, you are vulnerable to the notorious \"parallel compression algorithm\" bug (https://dotnetzip.codeplex.com/workitem/14087), which has been reported and commented on by several developers unable to believe that its status remains low. There are a number of files (like .msi files) that will cause this bug to surface regularly (though still unpredictably). \r\n\r\nIn order to test whether this bug is the source of your problem, set \"zipTemp.ParallelDeflateThreshold = -1\" prior to zipTemp.Save(Response.OutputStream). If this is the source of your problem, then this line of code should fix the problem (though with the performance penalty of disabling the optimization). Other suggestions are to change the size of the internal buffer. \r\n\r\nI take the time to offer this because I empathize with the extremely high priority that such unpredictable, unexplained loss-of-data behavior is until understanding its cause and a work-around.",
      "PostedDate": "2013-11-26T06:58:30.68-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Adding ParallelDeflateThreshold = -1 did not resolve this issue and causes failure in downloads on IE9 without compatibility view.\r\n\r\nI still cannot offer file downloads to users who use compatibility view as files are corrupted.\r\n\r\nbtw the above code should read Response.Close() instead of Response.End()",
      "PostedDate": "2013-12-13T12:32:30.8-08:00",
      "Id": -2147483648
    }
  ]
}