{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "My code is as below but when I click to generate the zip file it generates it but throws an error \"Server cannot append header after HTTP headers have been sent.\"\n\n```\n        ErrorMessage.InnerHtml = \"\"\n        Dim filesToInclude As New System.Collections.Generic.List(Of String)()\n        Dim sMappedPath As String = Server.MapPath(\"fodder\")\n\n        For Each item In Repeater1.Items\n\n            Dim chkbox As CheckBox = CType(item.FindControl(\"include\"), CheckBox)\n            Dim lbl As Label = CType(item.FindControl(\"label\"), Label)\n\n            If Not (chkbox Is Nothing Or lbl Is Nothing) Then\n                If (chkbox.Checked) Then\n                    ErrorMessage.InnerHtml = ErrorMessage.InnerHtml & _\n                            String.Format(\"adding file: {0}<br/>\\n\", lbl.Text)\n                    filesToInclude.Add(System.IO.Path.Combine(sMappedPath, lbl.Text))\n                End If\n            End If\n        Next\n\n        If (filesToInclude.Count = 0) Then\n            ErrorMessage.InnerHtml = ErrorMessage.InnerHtml & \"You did not select any files?<br/>\\n\"\n        Else\n            Response.Clear()\n            Response.BufferOutput = False\n\n            Dim c As System.Web.HttpContext = System.Web.HttpContext.Current\n            Dim archiveName As String = String.Format(\"archive-{0}.zip\", DateTime.Now.ToString(\"yyyy-MMM-dd-HHmmss\"))\n            Response.ContentType = \"application/zip\"\n            Response.AddHeader(\"content-disposition\", \"filename=\" + archiveName)\n\n            Using zip As New ZipFile()\n                zip.AddFiles(filesToInclude, \"files\")\n                zip.Save(Response.OutputStream)\n            End Using\n\n            Response.Close()\n        End If\n```\n\nI am not sure what the issue is",
    "LastUpdatedDate": "2014-02-07T04:57:21.743-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Unassigned",
      "Severity": 0,
      "Id": 0
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2014-02-07T04:28:37.6-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Http exception",
    "Type": {
      "Name": "Unassigned",
      "Id": 5
    },
    "VoteCount": 1,
    "Id": 16700
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "Got it working using\r\n\r\n```\n        ErrorMessage.InnerHtml = \"\"\n        Dim filesToInclude As New System.Collections.Generic.List(Of String)()\n        Dim sMappedPath As String = Server.MapPath(\"fodder\")\r\n\r\n        Using zip As New ZipFile()\r\n\r\n\n            For Each item In Repeater1.Items\r\n\r\n                Dim chkbox As CheckBox = CType(item.FindControl(\"include\"), CheckBox)\n                Dim lbl As Label = CType(item.FindControl(\"label\"), Label)\r\n\r\n                If Not (chkbox Is Nothing Or lbl Is Nothing) Then\n                    If (chkbox.Checked) Then\n                        ErrorMessage.InnerHtml = ErrorMessage.InnerHtml & _\n                                String.Format(\"adding file: {0}<br/>\\n\", lbl.Text)\n                        filesToInclude.Add(System.IO.Path.Combine(sMappedPath, lbl.Text))\r\n\r\n                        'zip.AddFile(item.Value, \"files\")\n                    End If\n                End If\n            Next\r\n\r\n\n            Response.Clear()\n            Response.ContentType = \"application/zip\"\n            Dim archiveName As String = String.Format(\"archive-{0}.zip\", DateTime.Now.ToString(\"yyyy-MMM-dd-HHmmss\"))\n            Response.AddHeader(\"content-disposition\", \"filename=\" + archiveName)\r\n\r\n            zip.AddFiles(filesToInclude, \"files\")\n            zip.Save(Response.OutputStream)\r\n\r\n        End Using\n```",
      "PostedDate": "2014-02-07T04:57:21.743-08:00",
      "Id": -2147483648
    }
  ]
}