Completed
Last Updated: 24 Jul 2024 11:48 by ADMIN
Release 2024.1.305 (2024 Q1)
ADMIN
Created by: Deyan
Comments: 3
Category: ZipLibrary
Type: Feature Request
15

Add support for the creation of AES-encrypted archives.

There is a related feature request for the extraction of such archives: ZipLibrary: Add support for extraction of AES-encrypted archives.

Unplanned
Last Updated: 17 Aug 2017 09:14 by ADMIN
There should be API allowing to check if an archive is protected.
Unplanned
Last Updated: 20 Sep 2016 11:55 by ADMIN
Reading a password protected archive by passing a wrong password doesn't notify the user that the password is wrong. Accessing one of the entries in the archive throws a generic "Invalid data" exception.

Steps to reproduce:
1. Create a zip file with password.
2. Open the same archive with the API passing wrong password and then try to one of the entries.
Observed: InvalidDataException is thrown when trying to read one of the entries in the archive.
Expected: The exception should be more meaningful and if possible occur when reading the archive. There should be API allowing to check if the password is correct.
Unplanned
Last Updated: 17 Aug 2017 09:12 by ADMIN
Add functionality for the ZipPackage to span across multiple files.
Unplanned
Last Updated: 20 Jun 2018 16:01 by ADMIN
ADMIN
Created by: Martin Ivanov
Comments: 5
Category: ZipLibrary
Type: Feature Request
4
Provide a way for users to check whether a stream is a valid zip archive. Include a CRC check as well.
Unplanned
Last Updated: 20 Nov 2018 13:55 by ADMIN
Although it is mandatory according to the specification, It seems like other applications don't require this record. Trying to open such an archive with RadZipLibrary currently throws InvalidDataException. 7zip creates such files.
Unplanned
Last Updated: 07 May 2021 09:36 by ADMIN

Currently, an exception is thrown when the file being unzipped already exists in the destination folder. Expose overload of the ExtractToDirectory() method allowing users to overwrite files.

Alternatively, the ZipArchiveEntry.ExtractToFile() method can be used:

using (ZipArchive source = ZipFile.Open(sourceFileName, ZipArchiveMode.Read, null))
{
    foreach (ZipArchiveEntry entry in source.Entries)
    {
        string fullPath = Path.GetFullPath(Path.Combine(destinationDirectory, entry.FullName));

        if (Path.GetFileName(fullPath).Length != 0)
        {
            Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
            // The boolean parameter determines whether an existing file that has the same name as the destination file should be overwritten
            entry.ExtractToFile(fullPath, true);
        }
    }
}

Unplanned
Last Updated: 09 Mar 2023 09:18 by Remco
Created by: Remco
Comments: 0
Category: ZipLibrary
Type: Feature Request
3
Add support for self-extracting archive
Unplanned
Last Updated: 28 Mar 2018 22:34 by David Totzke
ADMIN
Created by: Deyan
Comments: 3
Category: ZipLibrary
Type: Feature Request
3

			
Completed
Last Updated: 14 Jun 2016 07:28 by ADMIN
Unplanned
Last Updated: 18 Apr 2018 10:27 by ADMIN
According to the specification, the Enhanced Deflating algorithm is similar to Deflate but uses a sliding dictionary of up to 64K.
Unplanned
Last Updated: 03 Dec 2018 12:35 by ADMIN
Telerik.Windows.Zip.InvalidDataException: 'Unknown compression method (0x92)' when initializing a Telerik.Windows.Zip.CompressedStream is thrown for some object streams (read from pdf) due to incorrect transformation header.
Unplanned
Last Updated: 26 Sep 2019 14:50 by ADMIN
During a ZipArchive creation, when a second stream for creating an entry is opened while the first is still in use the ZipArchive is created with no error message, but the first entry occurs broken (The destination file could not be created).
Unplanned
Last Updated: 02 Mar 2023 10:22 by Joe
Umlaut chars in file names not rendered correctly after extract form archive made with Windows, 7-Zip
Unplanned
Last Updated: 03 Oct 2018 16:42 by ADMIN
7zip and the Windows arvhiver report Data Error on all the files when the users try to extract an archive created with ZipLibrary and the default LzmaSettings.
Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)

The stream that is internally created by the CreateFromDirectory method remains opened and the user can't close it:

This is error message observed when using the below code snippet:

The process cannot access the file 'C:\Users\dyordano\OneDrive - Progress Software Corporation\MyProjects\1640071ZipFileCreateFromDirectory\myzip.zip' because it is being used by another process.

        static void Main(string[] args)
        {
            string archiveFileName = @"..\..\myzip.zip";
            string sourceDirectoryName = @"..\..\Folder";
            File.Delete(archiveFileName);
            Telerik.Windows.Zip.Extensions.ZipFile.CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);

            using (Stream stream = File.Open(archiveFileName, FileMode.Open))
            {

            }
        }

Workaround: 

        static void Main(string[] args)
        {
            string archiveFileName = @"..\..\myzip.zip";
            string sourceDirectoryName = @"..\..\Folder";
            File.Delete(archiveFileName);

          //  Telerik.Windows.Zip.Extensions.ZipFile.CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);
            CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);

            using (Stream stream = File.Open(archiveFileName, FileMode.Open))
            {

            }
        }

        private static void CreateFromDirectory(string sourceDirectoryName, string destinationArchiveFileName, Telerik.Windows.Zip.CompressionLevel compressionLevel, bool includeBaseDirectory)
        {
            Encoding entryNameEncoding = null;
            DeflateSettings compressionSettings = new DeflateSettings()
            {
                CompressionLevel = compressionLevel,
                HeaderType = CompressedStreamHeader.None
            };
            char[] directorySeparatorChar = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };

            sourceDirectoryName = Path.GetFullPath(sourceDirectoryName);
            destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName);
            FileStream fileStream = File.Open(destinationArchiveFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None); ;
            using (ZipArchive zipArchive = new ZipArchive(fileStream, ZipArchiveMode.Create,false,  entryNameEncoding))
            {
                bool empty = true;

                DirectoryInfo directoryInfo = new DirectoryInfo(sourceDirectoryName);
                string fullName = directoryInfo.FullName;
                if (includeBaseDirectory && directoryInfo.Parent != null)
                {
                    fullName = directoryInfo.Parent.FullName;
                }

                foreach (FileSystemInfo fileSystemInfo in directoryInfo.EnumerateFileSystemInfos("*", SearchOption.AllDirectories))
                {
                    empty = false;

                    int length = fileSystemInfo.FullName.Length - fullName.Length;
                    string entryName = fileSystemInfo.FullName.Substring(fullName.Length, length);
                    entryName = entryName.TrimStart(directorySeparatorChar);

                    DirectoryInfo subfolder = fileSystemInfo as DirectoryInfo;
                    if (subfolder != null)
                    {
                        if (IsDirectoryEmpty(subfolder))
                        {
                            zipArchive.CreateEntry(string.Concat(entryName, Path.DirectorySeparatorChar));
                        }
                    }
                    else
                    {
                        ZipFile.CreateEntryFromFile(zipArchive, fileSystemInfo.FullName, entryName, compressionSettings);
                    }
                }

                if (includeBaseDirectory && empty)
                {
                    zipArchive.CreateEntry(string.Concat(directoryInfo.Name, Path.DirectorySeparatorChar));
                }
            }
        }
        private static bool IsDirectoryEmpty(DirectoryInfo directoryInfo)
        {
            bool empty = true;

            using (IEnumerator<FileSystemInfo> enumerator = directoryInfo.EnumerateFileSystemInfos("*", SearchOption.AllDirectories).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    empty = false;
                }
            }

            return empty;
        }

Note: We should ensure that all of the obsolete API that used to use the "leave open" flag don't keep the stream locked.

 

Unplanned
Last Updated: 08 Mar 2024 06:47 by Joe
When extracting zip archives that contain empty folders with 7zip an error message occurs: "Headers Error"

Completed
Last Updated: 15 May 2024 06:27 by ADMIN
Release 2024.2.426 (2024 Q2)

The attached gif file illustrates the inability to open the newly added file with the password: 

Sub Main()
	Dim sZipFilePath As String = "..\..\test.zip"
	File.Delete(sZipFilePath)

	CreateArchive(sZipFilePath)
	Dim decryptionSettings As DecryptionSettings = EncryptionSettings.CreateDecryptionSettings()
	AddHandler decryptionSettings.PasswordRequired, AddressOf DecryptionSettings_PasswordRequired
	Dim compressionSettings As CompressionSettings = Nothing
	Dim encoding As Encoding = Nothing
	Using oFS As FileStream = File.Open(sZipFilePath, FileMode.OpenOrCreate)


		Using oArchive As ZipArchive = ZipArchive.Update(oFS, encoding, compressionSettings, decryptionSettings)
			Using entry As ZipArchiveEntry = oArchive.CreateEntry("newText.txt")
				Dim writer As StreamWriter = New StreamWriter(entry.Open())
				writer.WriteLine("Hello world!")
				writer.Flush()
			End Using
		End Using
	End Using
End Sub

Private Sub CreateArchive(sZipFilePath As String)
	Using stream As Stream = File.Open(sZipFilePath, FileMode.Create)
		Dim _encryptionSettings As PasswordEncryptionSettings = EncryptionSettings.CreatePkzipPasswordEncryptionSettings()
		_encryptionSettings.Password = "telerik"
		Dim compressionSettings As CompressionSettings = Nothing
		Dim encoding As Encoding = Nothing

		Using archive As ZipArchive = ZipArchive.Create(stream, encoding, compressionSettings, _encryptionSettings)

			Using entry As ZipArchiveEntry = archive.CreateEntry("text.txt")
				Dim writer As StreamWriter = New StreamWriter(entry.Open())
				writer.WriteLine("Hello world!")
				writer.Flush()
			End Using
		End Using
	End Using
End Sub

Private Sub DecryptionSettings_PasswordRequired(ByVal sender As Object, ByVal e As PasswordRequiredEventArgs)
	e.Password = "telerik"
End Sub

 

Workaround: Until this bug is fixed the obsolete API could be used instead: 

ZipArchive archive = new ZipArchive(stream, ZipArchiveMode.Create, true, encoding, compressionSettings, encryptionSettings)
and
ZipArchive oArchive = new ZipArchive(stream, ZipArchiveMode.Update, true, encoding, compressionSettings, decryptionSettings)

Declined
Last Updated: 23 Oct 2019 06:18 by ADMIN
Created by: Nick
Comments: 1
Category: ZipLibrary
Type: Feature Request
0

Provide a simple method to detect that a password for a ZIP file is not valid.

The current implemention usually throws an exception (which does not definitively identify the password as wrong), but not always. Sometimes it just returns corrupt data.

It would be nice to  either have a typed exception consistently thrown, or a method to specifically check for an invalid password.

Thanks. 

Unplanned
Last Updated: 15 Jun 2021 08:25 by ADMIN
Created by: Paweł Korczak
Comments: 0
Category: ZipLibrary
Type: Feature Request
0
According to the .ZIP File Format SpecificationBZIP2 is an open-source data compression algorithm developed by Julian Seward.
1 2