Compose Multi-volume 7z Archive

Overview

Aspose.ZIP for .NET allows you to create 7z archives split into multiple files (volumes). This is achieved using the SaveSplit methdod, which divides a large archive into several parts for easier storage and transfer.

Options for split archive

To configure how a 7z archive is split, use the SplitSevenZipArchiveSaveOptions constructor, which requires two parameters:

The output files will have sequential extensions: .7z.001, .7z.002, .7z.003, and so on. The last part is typically smaller than the specified size if the total data does not divide evenly.

Compose multi-volume archive

The following example demonstrates how to create a split 7z archive with each part sized at 65,536 bytes (except, possibly, the last volume). The part files will be named part.7z.001, part.7z.002, part.7z.003, etc.

1    FileInfo fi1 = new FileInfo("alice29.txt");
2    FileInfo fi2 = new FileInfo("picture.png");
3
4    using (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipPPMdCompressionSettings())))
5    {
6        archive.CreateEntry("alice29.txt", fi1);
7        archive.CreateEntry("picture.png", fi2);
8        archive.SaveSplit(@"C:\Folder",  new SplitSevenZipArchiveSaveOptions("part", 65536));
9    }

Multi-volume 7z archives support all 7z features, including encryption and any supported compression method, just like regular 7z archives.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.