login about faq

Hi,

I am using Chilkat.NET 4 Trail Version.

I am trying to zip PDF's from a Directory and Write it to memory stream by calling Zip.WriteToMemory(). If the size of all PDF's were 420 MB, then zip's to around 350 MB successfully writes to memory. But if I add some PDF's in that directory and increasing the size to 600 MB, then Zip.WriteToMemory() returns 0 bytes.

        string filePath = @"<local path>";
        string[] fileList = Directory.GetFiles(filePath, "*.pdf");
        Chilkat.Zip zip = new Chilkat.Zip();
        zip.UnlockComponent("30-day trial");
        zip.NewZip("Test.zip");
        foreach (string file in fileList)
        {
           zip.AppendFromDir = file;
           Chilkat.ZipEntry entry = zip.GetEntryByName(file);
           if (null != entry)
                 zip.DeleteEntry(entry);
           zip.AppendFiles(file, false);
        }
        byte[] zipBytes = zip.WriteToMemory(); //Returns byte array if the total zipped size is 350MB. If size increased then returning 0 bytes.
        MemoryStream str = new MemoryStream(zipBytes);

Please help.

Thanks.

asked Mar 13 '13 at 07:02

SathishDV's gravatar image

SathishDV
1112

edited Mar 13 '13 at 07:04


WriteToMemory supports zips up to 4GB in size (32-bit). However, Chilkat Zip automatically supports Zip64 when writing to files. In other words, there is basically no limitation to the size of a zip when writing to a file.

If WriteToMemory returns 0 bytes, then examine the LastErrorText.

link

answered Mar 13 '13 at 10:27

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Hi,

Thanks for your quick reply.

I have examined the LastErrorText which displayed Out of Memory exception.

I have system with 4 GB RAM and I am trying to zip.WriteToMemory with 2GB data, but still out of memory exception being thrown.

Please advice.

Thanks,

link

answered Mar 13 '13 at 11:58

SathishDV's gravatar image

SathishDV
1112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×87
×8
×2
×1

Asked: Mar 13 '13 at 07:02

Seen: 1,436 times

Last updated: Mar 13 '13 at 11:58

powered by OSQA