{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi there guys, this is my first time here, and let me know if you see me doing anything wrong in the code snippets below.  Any help would be greatly appreciated.  I;'m really behind on this project so if you can kindly respond it would make life a lot easier.\nThanks,\n  Romel Evans\n\nProblem description:\n\nBasically I have 2 files that have been uploaded, zipped individually (using DotNetZip) and the byte array stored in the  SQL DB.\n\nWhen I attempt to unzip them to the same temp directory that I zipped them from, I get the following \n\nSystem.Exception: Ionic.Zip.ZipException: Bad Directory ---> System.ArgumentException: That name specifies an existing directory. Please specify a filename. Parameter name: fileName --- End of inner exception stack trace\n\nHere's the code below:\n\nPublic Sub UnzipByteArray(ByVal file() As Byte, ByVal dir As String, ByVal outputFile As String)\n        Try\n            Using zf As ZipFile = ZipFile.Read(file)\n                For Each entry As ZipEntry In zf\n                    entry.Extract(dir, ExtractExistingFileAction.OverwriteSilently)\n                    zf.Save(dir + \"\\\" + outputFile)\n                Next\n            End Using\n        Catch ex As Exception\n            Throw New Exception(ex.ToString)\n        End Try\n    End Sub",
    "LastUpdatedDate": "2013-02-21T18:42:41.913-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2013-01-18T06:52:29.78-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Is it possible to extract zipped files from DB to file system?",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 2,
    "Id": 15972
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "Hello\r\n\r\nI have done this for several projects with no problems. The only thing that comes to mind is that possibly there is directory information stored in the compressed .zip files, and the extract function is attempting to re-create the directories.\r\n\r\nWhen you create the .zip files (when the files are uploaded) I always ensure that the file is added to the root of the .zip file (without any directory information) by supplying an empty string as the second parameter of the ZipFile.AddFile method. As you are zipping each file separately this should cause no problems.\r\n\r\nHope this helps.\n",
      "PostedDate": "2013-02-17T02:13:06.633-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-17T02:13:54.287-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Thank you so much for replying.  This was so long ago that I found the solution to my problem in the mean time.   I don't have the code in front of me right now to post it, but the above code wasn't far from being correct.  What I'm surprised about is that only one person ever answered this question after such a long time.  ",
      "PostedDate": "2013-02-18T01:17:56.403-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:42:41.913-08:00",
      "Id": -2147483648
    }
  ]
}