[
  {
    "Id": "217745",
    "ThreadId": "64042",
    "Html": "<p>Hi,</p>\r\n<p>I have the following code which creates a zip file with a password. However, when I extract it, it's not asking for any kind of password. Please let me know, how to resolve this issue.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>                Response.Clear();\r\n                Response.BufferOutput = <span style=\"color:Blue\">false</span>;\r\n                <span style=\"color:Blue\">string</span> archiveName = String.Format(<span style=\"color:#A31515\">&quot;archive-{0}.zip&quot;</span>,\r\n                                                  DateTime.Now.ToString(<span style=\"color:#A31515\">&quot;yyyy-MMM-dd-HHmmss&quot;</span>));\r\n                Response.ContentType = <span style=\"color:#A31515\">&quot;application/zip&quot;</span>;\r\n                Response.AddHeader(<span style=\"color:#A31515\">&quot;content-disposition&quot;</span>, <span style=\"color:#A31515\">&quot;attachment; filename=&quot;</span> + archiveName);\r\n\r\n                <span style=\"color:Blue\">using</span> (ZipFile zip = <span style=\"color:Blue\">new</span> ZipFile())\r\n                {\r\n                    zip.AddFile(<span style=\"color:#A31515\">@&quot;C:\\Test.xls&quot;</span>, <span style=\"color:#A31515\">&quot;Zipped&quot;</span>);\r\n                    zip.Password = <span style=\"color:#A31515\">&quot;123456!&quot;</span>;\r\n                    zip.Save(Response.OutputStream);\r\n                }\r\n\r\n                HttpContext.Current.ApplicationInstance.CompleteRequest();\r\n</pre>\r\n</div>\r\n</p>",
    "PostedDate": "2009-07-30T13:24:11.703-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217752",
    "ThreadId": "64042",
    "Html": "<p>Hi,</p>\r\n<p>You have to set password before adding the files.</p>\r\n<p><span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())<br>{</p>\r\n<p>&nbsp;&nbsp; zip.Password = <span style=\"color:#a31515\">&quot;123456!&quot;</span>;<br>&nbsp;&nbsp; zip.AddFile(<span style=\"color:#a31515\">@&quot;C:\\Test.xls&quot;</span>, <span style=\"color:#a31515\">&quot;Zipped&quot;</span>);<br>&nbsp;&nbsp; zip.Save(Response.OutputStream);<br>}</p>",
    "PostedDate": "2009-07-30T13:45:53.763-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217762",
    "ThreadId": "64042",
    "Html": "<p>Thanks ,It's now asking for password. But it's not accepting whatever password I provide.</p>\r\n<p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre><span style=\"color:Blue\">using</span> (ZipFile zip = <span style=\"color:Blue\">new</span> ZipFile())\r\n                {\r\n                    zip.Password = <span style=\"color:#A31515\">&quot;123456&quot;</span>;\r\n                    zip.AddFile(<span style=\"color:#A31515\">@&quot;C:\\Test.xls&quot;</span>, <span style=\"color:#A31515\">&quot;Zipped&quot;</span>);\r\n                    zip.Save(Response.OutputStream);\r\n                }\r\n</pre>\r\n</div>\r\n</p>\r\n<p>When I extract the Zipped Archive, it throws an error saying wrong password. What am I doing wrong here?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-30T14:00:10.713-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217766",
    "ThreadId": "64042",
    "Html": "<p>I don't know what you're doing wrong.&nbsp; A couple things could be happening:</p>\r\n<ul>\r\n<li>in an earlier version of DotNetZip there was a problem saving password-protected files to a nonseekable stream, like Response.OutputStream in ASP.NET.&nbsp; That problem was fixed.&nbsp; If you are using the latest library you won't have this problem. </li>\r\n<li>maybe there is a code problem in your extract logic? </li>\r\n</ul>\r\n<p>did you try unpacking it with Windows Compressed Folders or winzip or some other password-aware zip archive tool?&nbsp; do you get the same results there?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-30T14:12:09.497-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217769",
    "ThreadId": "64042",
    "Html": "<p>Hi Cheeso,</p>\r\n<p>I am using the latest version of DotNetZip (V 1.8). I downloaded the MSI and installed it. And I copied the <strong>Ionic.Zip.dll</strong> into my project folder and I am using this dll.</p>\r\n<p>I tried with WinZip and WinRar , both of them give the same error saying password is wrong. Without Password, I am able to extract and view the file.</p>\r\n<p>&nbsp;</p>\r\n<p>Below is the Complete Extraction Logic:</p>\r\n<p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre> Response.Clear();\r\n Response.BufferOutput = <span style=\"color:Blue\">false</span>;\r\n <span style=\"color:Blue\">string</span> archiveName = String.Format(<span style=\"color:#A31515\">&quot;archive-{0}.zip&quot;</span>,\r\n                                DateTime.Now.ToString(&quot;yyyy-MMM-dd- \r\n                                                                                  HHmmss&quot;));\r\n Response.ContentType = <span style=\"color:#A31515\">&quot;application/zip&quot;</span>;\r\n Response.AddHeader(<span style=\"color:#A31515\">&quot;content-disposition&quot;</span>, &quot;attachment;  \r\n                                                        filename=&quot; + archiveName);\r\n\r\n <span style=\"color:Blue\">using</span> (ZipFile zip = <span style=\"color:Blue\">new</span> ZipFile())\r\n {\r\n    zip.Password = <span style=\"color:#A31515\">&quot;123456&quot;</span>;\r\n    zip.AddFile(<span style=\"color:#A31515\">@&quot;C:\\Test.xls&quot;</span>,<span style=\"color:#A31515\">&quot;Zipped&quot;</span>);\r\n    zip.Save(Response.OutputStream);\r\n }\r\nHttpContext.Current.ApplicationInstance.CompleteRequest();\r\n</pre>\r\n</div>\r\n</p>\r\n<p>Thanks</p>\r\n<p>Abhijith</p>",
    "PostedDate": "2009-07-30T14:20:39.627-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217817",
    "ThreadId": "64042",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=8271\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2009-07-30T17:24:14.59-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217818",
    "ThreadId": "64042",
    "Html": "<p>Hi Cheeso,</p>\r\n<p>Thanks for the&nbsp;update. How will this discussion proceed now? Should I do anything now? I mean, I already have the issue put down. Will anyone try to solve that issue and update me?</p>\r\n<p>I am not sure how this Issue tracker works.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-30T17:30:47.173-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217848",
    "ThreadId": "64042",
    "Html": "<p>I've produced a fix.&nbsp; The problem occurred only when zip files get saved to non-seekable streams, like ASPNET's Response.OutputStream. There is a section in the zip specification dealing with non-seekable streams that says &quot;applications sometimes do X and sometimes do Y&quot;, in regards to formatting of the zip file.&nbsp; The specification also said &quot;tools should be able to read either format.&quot;&nbsp; Well DotNetZip did X, and was able to READ either format, according to the spec.&nbsp; But WinZip was not able to read either format.&nbsp; It expected format Y.&nbsp;</p>\r\n<p>The way to fix this is to modify DotNetZip to conform to the format that WinZip expects.&nbsp; It's a pretty simple fix.&nbsp; But that change means I have to write a bunch of new tests to verify that the zipfiles DotNetZip produces are compatible with WinZip, 7zip, and a bunch of other libraries.</p>\r\n<p>That is all done now. I am producing the release now.&nbsp; In a few moments you'll be able to download it and test it yourself.</p>\r\n<p>I'll let you know.</p>",
    "PostedDate": "2009-07-30T20:35:03.373-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "217850",
    "ThreadId": "64042",
    "Html": "<p>ok, download v1.8.4.14, it has the fix you need.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-30T20:45:37.787-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218000",
    "ThreadId": "64042",
    "Html": "<p>Hi Cheeso,</p>\r\n<p>It works like a charm!!! Thanks for the quick fix.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-31T07:00:31.447-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218038",
    "ThreadId": "64042",
    "Html": "<p>you're welcome. thanks for reporting the problem.</p>",
    "PostedDate": "2009-07-31T08:19:02.67-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218178",
    "ThreadId": "64042",
    "Html": "<p>Hey,</p>\r\n<p>I noticed that you've changed the title as: &quot;<span>WinZip cannot open ZIP that uses PkzipWeak password protection&quot;. But on the contrary, I am able to extract files with PkzipWeak and not with any of the </span>WinZipAes types.</p>\r\n<p>It gives the following message:</p>\r\n<p>&nbsp;</p>\r\n<p><strong>Extracting to &quot;C:\\DOCUME~1\\LOCALS~1\\Temp\\&quot;<br>Use Path: no&nbsp;&nbsp; Overlay Files: yes<br>skipping: Zipped/USReports.xls&nbsp;&nbsp;&nbsp; unsupported compression method 99<br>error:&nbsp; no files were found - nothing to do</strong></p>",
    "PostedDate": "2009-07-31T15:08:18.46-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218248",
    "ThreadId": "64042",
    "Html": "<p>Hey&nbsp;Abhijith,</p>\r\n<p>The problem I fixed, based on this thread, was that WinZip could not open ZIP files generated by DotNetZip, which used PkzipWeak encryption, and which were streamed out to ASPNET's Response.OutputStream.</p>\r\n<p>I also understand that you confirmed that this problem was, in fact, fixed, with the changes I made. (&quot;It works like a charm.&quot;)</p>\r\n<p>If that's not your understanding, please advise.</p>\r\n<p>if you have a new, different&nbsp;problem, then&nbsp;you should open a new thread.</p>\r\n<p><em>EDIT</em>: I have a bunch of tests for WinZip AES encryption, including tests for producing a WinZIP AES-encrypted ZIP file from within an ASP.NET web page. All those tests pass. I can read such a zip with WinZip.</p>\r\n<p>So, in the new thread you create, describing the new problem you're having,&nbsp;you will need to give me some additional information about the problem, how you can make it happen, what tool you are using to unzip, etc. Compression method 99 is the method for AES-encrypted&nbsp;zip files.&nbsp; So if your tool says it is not supported, it's possible that it just doesn't know how to open AES files. Maybe you're on a&nbsp;trial version or something.&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-01T00:14:26.647-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]