Extracting zip file with nested files containing dots and spaces

i got this following zip file name System Update 1.2.4.zip

The file structure inside the file is as following:

System Update 1.2.4
  Files
  Software
  Changelog.txt

I’m using the following line to extract my file

ZipFile.ExtractToDirectory(zipPath, extractPath);

The zipPath and extractPath is correct, but i’m getting the following error:

An unhandled exception of type 'System.IO.IOException' occurred in System.IO.Compression.FileSystem.dll

Additional information: Zip entry name ends in directory separator character but contains data.

I couldn’t find the error on MSDN, the error list for IOException listed there is:

The directory specified by destinationDirectoryName already exists.
-or-
The name of an entry in the archive is Empty, contains only white space, or contains at least one invalid character.
-or-
Extracting an archive entry would create a file that is outside the directory specified by destinationDirectoryName. (For example, this might happen if the entry name contains parent directory accessors.)
-or-
An archive entry to extract has the same name as an entry that has already been extracted from the same archive.

EDIT: i want to extract it without renaming the files


Source: .net

Leave a Reply