Merge archives

How to merge archive files in C#

GroupDocs.Merger allows developers to combine multiple ZIP documents in the preferred order and save them as a single file. You will not spend your time doing these operations manually on desktop software. With GroupDocs.Merger it is possible to combine archive documents of any archive extensions such as ZIP or TAR.

The following example demonstrates how to merge archive files with several lines of C# code:

  • Create an instance of Merger class and pass source archive file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
  • Add another archive file to merge with Join method. Repeat this step for other archive documents you want to merge.
  • Call Merger class Save method and specify the filename for the merged archive file as parameter.
// Load the source archive file
using (Merger merger = new Merger(@"c:\sample1.zip"))
{
    // Add another archive file to merge
    merger.Join(@"c:\sample2.zip");
    // Merge archive files and save result
    merger.Save(@"c:\merged.zip");
}

Merge different archive file formats

This section describes how to merge different archive file formats using GroupDocs.Merger API. Please look at the articles listed below:

Code Examples

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!

Merge Archives Live Demo

GroupDocs.Merger for .NET provides online ZIP Merger App and TAR Merger App, which allow you to try it for free and check its quality and accuracy.