简体   繁体   中英

Extract .7Z file using sevenzip doesn't work for larger files >1GB

The sevenzip extractor works fine and its good to extract small.7Z files. The same code when used to extract large file(1gb), getting the below exception.

在此处输入图像描述

SevenZipExtractor extractor = new SevenZipExtractor(@"\\Sourcepath\test_20191024143230.7z");
if (extractor.Check())
{
    using (var tmp = new SevenZipExtractor(@"\\DestinationPath\test"))
    {
        for (int i = 0; i < tmp.ArchiveFileData.Count; i++)
        {
            tmp.ExtractFiles(@"C:\Users\ot97813\RPC_CodeBase\UnZip File\ExtractPath\", tmp.ArchiveFileData[i].Index);
        }
    }
}

looked in all websites and I didn't find this doesn't support extraction of larger files. Note: The file is not encrypted or password protected.

This is not an answer, just a proof SevenZipExtractor that is working.

using System;
using SevenZipExtractor; // https://github.com/adoconnection/SevenZipExtractor
using ByteSizeLib; // https://github.com/omar/ByteSize

namespace ConsoleAppSevenZipExtractor
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ArchiveFile archiveFile = new ArchiveFile(@"C:\test.7z"))
            {
                foreach (var entry in archiveFile.Entries)
                {
                    Console.WriteLine($"{entry.FileName} with {ByteSize.FromBytes(entry.Size)}");

                    // extract to file to current path
                    entry.Extract(entry.FileName);
                }
            }

            Console.ReadKey();
        }
    }
}

7Zip Archive used has around 2 Gb

Console output:

text.txt with 88.13 KB

video.mp4 with 1.96 GB

promo.jpg with 56.98 KB

On bin/debug files are extracted

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM