[
  {
    "Id": "94454",
    "ThreadId": "28314",
    "Html": "I have a zip archive that I would like to create, and want to overwrite the current zip archive.&nbsp; zip.save(); doesn't seem to do this.&nbsp; How would I go about overwriting the file?<br>\r\n<br>\r\nAny ideas are greatly appreciated.<br>\r\n<br>\r\nThanks Again,<br>\r\n",
    "PostedDate": "2008-05-23T12:24:26.483-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "94574",
    "ThreadId": "28314",
    "Html": "The expected behavior of ZipFile.Save() is to overwrite any existing zip archive by the specified name. <br>\r\n<br>\r\nI just added a test case to verify that the expected behavior is, in fact, the observed behavior.   It works as advertised.<br>\r\n<br>\r\nWhat behavior or exception do you see?<br>\r\n",
    "PostedDate": "2008-05-24T11:42:18.523-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "94672",
    "ThreadId": "28314",
    "Html": "I am not getting any sort of error or anything, but the file is not being overwritten with the new zip.&nbsp; I just tried this again, and upon inspection of the zip, the new images and files are not contained in the new zip.<br>\r\n<br>\r\nHere is my code:<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (File.Exists(FilePathTB1.Text + @&quot;\\Backup.zip&quot;))<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DialogResult dr = MessageBox.Show(&quot;This File Already Exists!&nbsp; Would You Like To Overwrite It?&quot;, &quot;Confirm&quot;, MessageBoxButtons.OKCancel);<br>\r\n<br>\r\n&nbsp;&nbsp;&nbs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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Add the Files Folders and subdirectories to the zip<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.AddItem(&quot;Files&quot;);<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label2.Text = &quot;Backing up Files (Images, etc.)...&quot;;<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProgressBar1.Increment(70);<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Save the zip<br>\r\n&nbsp;&nbsp;&nbsp;&nb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&nbsp;&nbsp;&nbsp; break;<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case DialogResult.Yes:<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>\r\n",
    "PostedDate": "2008-05-25T17:07:22.143-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95061",
    "ThreadId": "28314",
    "Html": "Any chance you could drop a MessageBox.Show() in the Catch { }  clause of your DialogResult.OK case? <br>\r\nMaybe there is an exception occurring that you are swallowing? <br>\r\n<br>\r\nOne thing - as currently configured, you cannot add a file into the zip, that already exists in the zip.  <br>\r\nSo let's say you Create backup.zip, and in it you put a file called &quot;DB.accdb&quot; and a directory called &quot;Files&quot;. <br>\r\n<br>\r\nThen you update &quot;DB.accdb&quot;.  You want to update the Backup.zip with this new content. <br>\r\nYour code does this: <br>\r\n<span style=\"font-size:12px;font-family:courier new\">  using (ZipFile zip = new ZipFile(FilePathTB1.Text + @&quot;\\Backup.zip&quot;))<br>\r\n  {<br>\r\n    zip.AddFile(&quot;DB.accdb&quot;); <br>\r\n  }<br>\r\n</span><br>\r\nThis will throw.  You cannot, with the current Zip Library, call ZipFile.AddFile() using a file that already exists in the Backup.zip. So you cannot call zip.Add(&quot;Readme.txt&quot;).   If you try this, an exception will be thrown. <br>\r\n<br>\r\nThe workaround is to create a new zip archive, and overwrite the existing one. <br>\r\n<br>\r\nA reasonable feature request for the DotNetZip library is to allow ZipFile.Add(string Filename) when a file by the name of Filename already exists in the zip archive. <br>\r\nThat seems like a reasonable thing, I'll have to think about how to do it.  <br>\r\n<br>\r\nOption 1:<br>\r\nexpand the meaning of AddFile() to allow any file, even files already added to the archive?  This seems maybe a little wrong.  It changes the behavior of the existing library, and so may break existing apps. <br>\r\n<br>\r\nOption 2: <br>\r\nadd a flag to the ZipFile object, named, say, AllowUpdate.  This would explicitly allow the behavior that currently throws an exception.   This would not break existing apps. <br>\r\n<br>\r\nOption 3:<br>\r\nadd another method, for example ZipFile.UpdateFile().  This also would not break existing apps.<br>\r\n<br>\r\nOr I could do a combination of Option 2 &amp; 3. <br>\r\n<br>\r\nyour vote?<br>\r\n",
    "PostedDate": "2008-05-27T15:40:15.683-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95139",
    "ThreadId": "28314",
    "Html": "Thank you very much for you response.  I will add a catch, and post back with that information.  <br>\r\n<br>\r\nWith regards to the addition of some form of file overwrite within DotNetZip, I do agree with you on Option 1.  Personally, my preference would probably be Option 3.  As I'm understanding it, it would be something like this, correct:<br>\r\n<br>\r\nusing (ZipFile zip = new ZipFile.UpdateFile(FilePathTB1.Text + @&quot;\\Backup.zip&quot;))<br>\r\n<br>\r\nWould this specify ZipFile.UpdateFile and ZipFile.NewFile?  I'm just curious what exactly you have in mind, as I want to make sure I am understanding how you mean.<br>\r\n<br>\r\nThanks Again for an incredible utility.  I will post back with the catch information as soon as possible.<br>\r\n<br>\r\nThanks Again,<br>\r\n",
    "PostedDate": "2008-05-28T00:31:55.877-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95288",
    "ThreadId": "28314",
    "Html": "<p>What I am thinking about is this...<br>\r\nYou would create a zip file as normal, for example: </p>\r\n<blockquote>\r\n<pre>      using (ZipFile z1 = new ZipFile())\r\n      {\r\n        String[] filenames = System.IO.Directory.GetFiles(&quot;DirectoryToBackup&quot;);\r\n        foreach (String f in filenames)        \r\n          z1.AddFile(f, &quot;&quot;);        \r\n        z1.Comment = &quot;This archive is a backup&quot;;\r\n        z1.Save(ZipFileToCreate);\r\n      }\r\n</pre>\r\n</blockquote>\r\n<p>Then, to update an entry in that zipfile, you might do something like this: </p>\r\n<blockquote>\r\n<pre>      // update that file in the zip archive\r\n      using (ZipFile z2 = ZipFile.OpenForUpdate(ZipFileToCreate))\r\n      {\r\n        z2.UpdateFile(NameOfFileToUpdate, &quot;&quot;);\r\n        z2.Comment = &quot;This backup archive has been updated.&quot;;\r\n        z2.Save();\r\n      }\r\n</pre>\r\n</blockquote>\r\n<p>There are two new methods on the ZipFile class here.  First, the OpenForUpdate() static method. It is like the static ZipFile.Read() method, but it opens the ZipFile and allows updates of the entries. (An alternative interface would be to use ZipFile.Read, coupled with a public boolean property, maybe named AllowUpdates.)    The second new method is the ZipFile.UpdateFile() method.  This must be used when adding a file to a zipfile, when an entry using that filename already exists in the zipfile.  [ We need the new method so as to not break the current behavior of AddFile() ]<br>\r\n<br>\r\nThe code using ZipFile.Read() and AllowUpdates might look like this: </p>\r\n<blockquote>\r\n<pre>      // update that file in the zip archive\r\n      using (ZipFile z3 = ZipFile.Read(ZipFileToCreate))\r\n      {\r\n        z3.AllowUpdates = true; \r\n        z3.UpdateFile(NameOfFileToUpdate, &quot;&quot;);\r\n        z3.Save();\r\n      }\r\n</pre>\r\n</blockquote>\r\n<p>I have checked in a changeset that does both of these - OpenForUpdate <i>as well as</i> Read + AllowUpdates. I haven't yet uploaded a binary. <br>\r\n<br>\r\nConsider also the removal case.  What if the application wants to remove a file from an existing zip archive?  Though the current (1.4) code does allow adding new entries to a ZipFile, it does not allow removing entries.  So we need a new method like ZipFile.RemoveEntry() for that purpose. <br>\r\n<br>\r\nThinking about this a bit more, it may be that we don't need the AllowUpdates flag, nor the OpenForUpdate() method.   If the only way to Update a file in a zip archive is to call a new API - UpdateFile() -  and the only way to remove an entry from a ZipFile is to call a new API - RemoveEntry()  -  then why not just use the existing static ZipFile.Read() method, and if the app calls these new APIs, allow it?  If the app calls AddFile() with a filename that corresponds to an entry already in the ZipFile, then throw as before.   <br>\r\n<br>\r\nIt would make for a simpler interface.   The code would then just be: <br>\r\n</p>\r\n<blockquote>\r\n<pre>      // update that file in the zip archive\r\n      using (ZipFile z3 = ZipFile.Read(ZipFileToCreate))\r\n      {\r\n        z3.UpdateFile(NameOfFileToUpdate, &quot;&quot;);\r\n        z3.Save();\r\n      }\r\n</pre>\r\n</blockquote>",
    "PostedDate": "2008-05-28T11:54:29.76-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95293",
    "ThreadId": "28314",
    "Html": "<p>Taking it one step further, maybe what we want is to also introduce a new method AddOrUpdateFile(), which adds the file if it is not present, and updates the file if it is present in the ZipFile. <br>\r\nThat would simplify the interface for producing backups. </p>\r\n<blockquote>\r\n<pre>      // add or update a file in the zip archive\r\n      using (ZipFile z3 = ZipFile.Read(ZipFileToCreate))\r\n      {\r\n        // always works, whether the file already exists in the archive or not\r\n        z3.AddOrUpdateFile(NameOfFileToUpdate, &quot;&quot;);\r\n        z3.Save();\r\n      }\r\n</pre>\r\n</blockquote>\r\n<p>and of course, if you want just Update, or just Add, you can just UpdateFile or AddFile too.  \r\nI'll work on this and produce something later today. \r\n</p>\r\n",
    "PostedDate": "2008-05-28T12:05:20.21-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95354",
    "ThreadId": "28314",
    "Html": "OK, Check the preview of Release 1.5 for this capability.   You can now Update entries within a zip file, and you can Remove entries from a zipfile. <br>\r\nCheck the doc for example code. <br>\r\n<br>\r\nThis capability should be fairly solid.<br>\r\n<br>\r\nIt is classified as a preview release, because I need to add some more stuff to it before it qualifies for a full release. <br>\r\n",
    "PostedDate": "2008-05-28T16:31:36.373-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95381",
    "ThreadId": "28314",
    "Html": "Cool.&nbsp; I downloaded and started playing around with the new build.&nbsp; Does this support AddOrUpdateItem()?&nbsp; I didn't see this included yet, and things are failing when I try to AddOrUpdateFile on an item (&quot;Files&quot;).&nbsp; It fails with a message that it could not find &quot;Files&quot;, which I don't quite understand, and a file in the application directory that I assume is the temporary zip before saving to the selected directory?<br>\r\n<br>\r\nThanks Again.&nbsp; I am very excited about these changes.<br>\r\n",
    "PostedDate": "2008-05-28T19:41:51.027-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95529",
    "ThreadId": "28314",
    "Html": "<p>There is no AddOrUpdateItem, yet.  I'm working on that. </p>\r\n<p>The garbage file left around in the temp directory - that's an issue with the library. For good hygiene it should clean up its droppings.  I'll file a workitem for that.</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2008-05-29T10:00:18.33-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95705",
    "ThreadId": "28314",
    "Html": "O.K., cool.&nbsp; I will continue playing around with AddOrUpdateFile, and will play around with AddOrUpdateItem once that is added as well.<br>\r\n<br>\r\nIt appears if the zip saves with no problems that the garbage file is cleaned up.&nbsp; But when it fails, the file remains.&nbsp; I did want to mention though that, for me, the garbage file is not being saved in the temp directory, but in the program directory...&nbsp; Is this because I am setting the System.IO.Directory.SetCurrentDirectory(Environment.CurrentDirectory); ?&nbsp; This is probably the case I would imagine...<br>\r\n<br>\r\nThanks Again, I look forward to the addition of AddOrUpdateItem...&nbsp; :-)<br>\r\n",
    "PostedDate": "2008-05-29T22:29:52.173-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "95727",
    "ThreadId": "28314",
    "Html": "Ok, I modified the interface so that there is AddFile AddDirectory AddItem, and UpdateFile UpdateDirectory UpdateItem. <br>\r\n<br>\r\nThere is no more AddOrUpdateXxxx().   I figure all the capability you want is in UpdateItem().  <br>\r\n<br>\r\n<br>\r\nI refreshed the binaries and source for v1.5 of the library.  Try it out.  <br>\r\n<br>\r\n<br>\r\nThe temp file is created in the working directory for the zip library.  This defaults to the current working directory.  You can change it by setting the TempFileFolder on the ZipFile instance. <br>\r\n<br>\r\nI have a workitem to clean up the trash files. <br>\r\nI haven't done anything with that one yet. <br>\r\n  <br>\r\n",
    "PostedDate": "2008-05-30T00:51:05.307-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "96386",
    "ThreadId": "28314",
    "Html": "Alright, I have been playing around with the updated release of 1.5 since its release, and everything seems to be working without any problems whatsoever...&nbsp; I will continue to play around with this (And any future updates), but did want to post back to let you know that I've had no problems thus far...<br>\r\n<br>\r\nThanks Again.&nbsp; :)<br>\r\n",
    "PostedDate": "2008-06-02T19:18:25.547-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]