sainath sagar
sainath sagar

Reputation: 509

How to skip ZIP64 format while zipping file above 4GB size in c#

Here I am trying to create zip file using .net 4.5 version which are having size greater than 4 GB. File format created as ZIP64. After that there is one more program written in java which will unzip and process. But java code is throwing error like "invalid entry size". Can we skip ZIP64 format so that java code can easily process the zip file ?

public static void ZipTest(string infile, string outfile)
{
   using (ZipArchive archive = System.IO.Compression.ZipFile.Open(outfile,                                         
                                                                 ZipArchiveMode.Create))
   {
     archive.CreateEntryFromFile(infile, Path.GetFileName(infile));
   }
}

Upvotes: 1

Views: 984

Answers (1)

Renat
Renat

Reputation: 8962

This is not possible, as original .ZIP format has a 4 Gb limit for in and out files.

From ZIP article on Wikipedia :

The maximum size for both the archive file and the individual files inside it is 4,294,967,295 bytes (23^2−1 bytes, or 4 GiB minus 1 byte) for standard ZIP.

Upvotes: 3

Related Questions