There is only 4GB size limit for standard ZIP format. There should be no issues for files around 100MB.
Can you please try to add the file using FileStream
and print its length and position at the start and at the end of the process?
Printing AddFile
's result and ZipItem
's properties would be useful as well.
You can do it like this:
// Add the file to newly created "files" folder within the zip file
using (var file = File.OpenRead(Temp_BPI_SaveLocation + strDataFileWithTimeStamp))
{
Console.WriteLine("Adding file of size: {0} starting at position: {1}.", file.Length, file.Position);
var result = zip.AddFile(file, @"\files\" + strDataFileWithTimeStamp);
Console.WriteLine("Added file of size: {0} ended at position: {1}.", file.Length, file.Position);
Console.WriteLine("Result: {0}, {1}, {2}.", result.FilesAffected, result.FilesCompressedLength, result.FilesUncompressedLength);
var item = zip[@"\files\" + strDataFileWithTimeStamp];
if (item == null)
Console.WriteLine("File not found in the Zip file.");
else
Console.WriteLine("Zip file lengths: {0}, {1}.", item.CompressedLength, item.Length);
}
I have tried the code above for 180MB file and the output looks like this:
Adding file of size: 181102014 starting at position: 0.
Added file of size: 181102014 ended at position: 181102014.
Result: 1, 180479584, 181102014.
Zip file lengths: 180479584, 181102014.
The file is present in the ZIP archive, it is non-empty and it can be decrypted successfully.
Please, post here:
- the output of modified code
- version of assemblies you are using