Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3860

Unable to zip and encrypt 100 MB file

$
0
0

We have a simple code that tries zip and encrypt a file. That code works perfectly for the moderately size files. However, when we try to encrypt and zip the file that has the size of 100MB, the contents of the file are lost in a process and the Rebex ends up zipping an empty file.

Is there a catch for handling large files?

Thank you in advance, here is our code

    using (ZipArchive zip = new ZipArchive(ZipFilePath, ArchiveOpenMode.Create))
    {
        // Set the Password first
        zip.Password = strUserPIN;

        // Change the default Encryption algorithm 
        zip.EncryptionAlgorithm = useAes256EncryptionForWinZip == "YES" ?
            Rebex.IO.Compression.EncryptionAlgorithm.Aes256 : Rebex.IO.Compression.EncryptionAlgorithm.Zip20;


        // Add the file to newly created "files" folder within the zip file
        zip.AddFile(Temp_BPI_SaveLocation + strDataFileWithTimeStamp, @"\files\");

        //Save the Zip file
        zip.Save();

        // cloase the zip file
        zip.Close();

    }

Viewing all articles
Browse latest Browse all 3860

Trending Articles