User (Old forums)MemberJune 21, 2007 at 12:38 pmPost count: 23064
I’m zipping and encrypting (AES) a folder with multiple folders and subfolders, a few of which are empty and using the QuickZip method. The empty folder disappear…any way to include them (other than the obvious trick of putting a dummy file in each)?
Imported from legacy forums. Posted by ed (had 3938 views)Xceed SupportMemberJune 21, 2007 at 2:11 pmPost count: 5658
With the QuickZip method using wildcards, you can not include empty folders to the archive. However, it is really easy to do with our FileSystem instead.
A folder listing containing:
AbstractFolder folder = new DiskFolder( @”C:\TestFolder” );
AbstractFile zipFile = new DiskFile(@”C:\ZipArchive.zip” );
AbstractFolder zipArc = new ZipArchive( zipFile );
folder.CopyTo( zipArc, true );
After, the ZipArchive.zip will contain:
Imported from legacy forums. Posted by CharlesB (had 246 views)User (Old forums)MemberJune 21, 2007 at 3:55 pmPost count: 23064
Yes…I’ve seen that technique used in other posts. But like I said…I’m encrypting it with AES. Is there a way to ensure the resultant archive file is encrypted?
Imported from legacy forums. Posted by ed (had 342 views)Xceed SupportMemberJune 22, 2007 at 10:23 amPost count: 5658
Sorry, I missed the AES part of the question.
AbstractFile zipFile = new DiskFile( @”D:\Dump\ZipTry.zip” );
AbstractFile textFile = new DiskFile( @”D:\Dump\Test.txt” );
ZipArchive zipArc = new ZipArchive( zipFile );
zipArc.DefaultEncryptionMethod = EncryptionMethod.WinZipAes;
zipArc.DefaultEncryptionPassword = “Sun”;
AbstractFile zippedFile = new ZippedFile( zipFile, @”subfolder\Test.txt” );
textFile.CopyTo( zippedFile, true );
The “Test.txt” file will be encrypted and nested inside the “subfolder”.
Imported from legacy forums. Posted by CharlesB (had 216 views)
- You must be logged in to reply to this topic.