[
  {
    "Id": "720341",
    "ThreadId": "284958",
    "Html": "\r\n<p>Hi,</p>\r\n<p>I have a problem with extracting a folder within a zip file with its partial path. Is that possible ?</p>\r\n<p>Basically the thing is lets say I have the following zip file:</p>\r\n<p>files\\file1.txt</p>\r\n<p>temp\\files\\file1.txt</p>\r\n<p>And I want to extract the directory &quot;temp\\&quot; from my zip file in directory &quot;C:\\qwerty\\&quot;</p>\r\n<p>If I extract it the normal way I would have &quot;C:\\qwerty\\temp\\files\\file1.txt&quot;.</p>\r\n<p>What I want to achieve is somehow to pass a relative path so that only the files/folders within that path are extracted without the path given. So in other words I would like to have my file extracted in the following way:</p>\r\n<p>&quot;C:\\qwerty\\files\\file1.txt&quot;</p>\r\n<p>I have figure out a solution but in the case above its not working. If I change the name for the item being extracted so that I delete the path in the beginning it is extracted. In the case above I change the name of &quot;temp\\files\\file1.txt&quot; to &quot;files\\file1.txt&quot;\r\n and receive an exception that the item with the same key already exists (which is normal as there is another file with the same path)</p>\r\n<p>Another way to achieve what I am trying is to extract everything in a temp folder and move it where I would like (this seems too complicated for such a small thing).</p>\r\n<p>My question is am I missing something or I should do it the hard way ?</p>\r\n<p>&nbsp;</p>\r\n<p>Greetings</p>\r\n",
    "PostedDate": "2012-01-04T08:07:52.557-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "721130",
    "ThreadId": "284958",
    "Html": "<p>You are not missing anything.</p>\r\n<p>I think you understand the situation pretty well.</p>\r\n<p>Each ZipEntry item in the ZipFile object must have a unique name. You can rename a ZipEntry before extracting, but you cannot rename an item using a name of a ZipEntry that already exists.</p>\r\n<p>One way to avoid the issue is to&nbsp; call ZipFile.Remove() on the ZipEntry with the existing name. If you like you can protect that call inside a try...catch clause if you're not sure that an item with the given name really exists.&nbsp; Or you could test for existence before deleting, and then rename.</p>\r\n<p>Anyway, it seems&nbsp;you understand it.</p>",
    "PostedDate": "2012-01-05T15:45:19.17-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "723496",
    "ThreadId": "284958",
    "Html": "<p>Hi Chesso,</p>\r\n<p>Thanks very much for the answer. It seems I will extract all the files in the Windows temp folder and after that moving them.</p>\r\n<p>Greetings</p>",
    "PostedDate": "2012-01-11T00:19:36.02-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]