Must end with a .zip extension exception

Nov 2, 2007 at 10:18 PM
Hi

The zip file I'm working with doesn't end with a .zip extension. I get an exception saying that the file must end with .zip when using the ZipFile constructor.

I'm working around this by using ZipFile.Read which doesn't do the .zip check. I'm just wondering is the .zip check really necessary?
Coordinator
Nov 2, 2007 at 10:42 PM
why the check for a .zip extension in the constructor? I wanted to insure that when creating a zip , people were clear that a zip extension needs to be used. if an app wants to create a .jar (or something else) then the app is free to rename the file that gets created.

Seems like you have a nice workaround in the Read() option.
Dec 27, 2007 at 8:52 PM
FYI, I'm working with two other file formats that use Zip file contents but with a different extension today. This is a pretty common scenario (nee System.IO.Packaging, OPC, SCORM eLearning packages, etc.) You may wish to reconsider whether hardcoding .zip extensions is really a benefit to this library...


Cheeso wrote:
why the check for a .zip extension in the constructor? I wanted to insure that when creating a zip , people were clear that a zip extension needs to be used. if an app wants to create a .jar (or something else) then the app is free to rename the file that gets created.

Seems like you have a nice workaround in the Read() option.

Coordinator
Jan 8, 2008 at 12:56 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Feb 5, 2008 at 1:22 AM


Cheeso wrote:
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.


This is fixed in changeset 14492.