Posted on: 12/24/2014 8:14:36 PM | Views : 536

Hi All
How to identify file type is zip or not (files are without any extension).
With the help of DotNetZip I was able to read data from a zip file without having to unzip the file but before doing this I want to confirm if file format is zip.  Not sure if this can be done with DotNetZip.
This code fails when file format is not zip.
bool? rs = opnFileDialog.ShowDialog(); if (rs == true) { // Read the files foreach (String file in opnFileDialog.FileNames) { using (ZipFile zip1 = ZipFile.Read(file)) { Note: There is no extension in file, so GetExtension will not help in this case.
Files are compressed and will open in winzip but just with no extension.
Thanks.

Go to the complete details ...