how to give multiple extenstions in SelectEntries method.

Dec 14, 2012 at 9:30 AM

I'm trying to Extract only the image files in the existing .zip file in MVC3 Project.

Here is what i have done so far to get it



string zipToUnpack = @"C:\Users\Public\Pictures\Sample Pictures\";
            string unpackDirectory = System.IO.Path.GetTempPath();
            using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
                // here, we extract every entry, but we could extract conditionally
                // based on entry name, size, date, checkbox status, etc.  
                var collections = zip1.SelectEntries("name=*.jpg;*.jpeg;*.png;*.gif;");
                foreach (var item in collections)
                    item.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);

I tried debugging my code. I've found that collections has 0 elements.
If i give only one extension, then it works well and good.

I need to extract all the image formats from .zip file

Can anyone please sort out this issue.