0 votes
by (130 points)

Hi Rebex-Team,

i have here a ZIP-Archive from a external team, that i must extract automatically to using in another program.

The archive was created with 7-zip 9.20 64-Bit on Ubuntu 16.04 TLS. The command was:

7z a "test_ubuntu.zip" "/tmp/test"

It seems that 7-zip does not store the File-Attribute in the Archive to the file (ZipItem.IsFile or ZipItem.ItemType = ArchiveItemType.File).

Extracting of the files with any Zip-Programs (WinRAR, WinZip, 7-zip) is possible without problems.

Is it possible in any way to extract the files? Follwing i have tried:

  • ZipItem.ExtractToFile("C:\test\" & ZipItem.Name, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • ZipItem.ExtractToDirectory("C:\", Rebex.IO.TraversalMode.NonRecursive, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • Extracting the whole Archive with ZipArchive.ExtractAll("C:\test", Rebex.IO.TransferMethod.Copy, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • I have nothing found in the options under ZipArchive.Options, especially .UnsupportedFeatureExtractMode

  • Tried several Events of the ZipArchive-Class

Nothing works. Is there any way to force the extraction of the files (for example overwriting the ZipItem.ItemType-Property or additional Options ZipArchive.Options.UnsupportedFeatureExtractMode)?

I have uploaded a sample ZIP-File here.

I have another Library (DevExpress) here, that can handle those Archives. But this Library have no equal PasswordRequired-Event.
In addition, i would realize this only with the Rebex-Librarys, because the Zip-Arichives send via Mail.

Thanks + Regards
Bernhard

1 Answer

+1 vote
by (72.7k points)
edited by

UPDATE:
The mentioned fix is now released (version 2017 R2).


Hello Bernhard and thank you for the excellent report.

The only problem is ZipItem.ItemType identification. It is caused by VersionNeeded field which has value 778 (which is far greater than supported by Rebex = 45). If interested, see 4.4.3 version needed to extract (2 bytes).

However, there is no need to check this field in case of your ZIP file, because it specifies ZipItem.ItemType for each item using external file attributes (unix permissions in this case).

I have improved ZipItem.ItemType identification and I will send you full binaries in a moment to your email.

Also, we will discuss whether to add an option to force item extraction if unsupported feature is detected.

by (130 points)
Hi Lukas,

excelent support (some companies can take a example to you) and explanation! Extraction of ZIP-Archive works fine now.

Thanks + Regards
Bernhard
...