User (Old forums)MemberSeptember 25, 2007 at 11:45 pmPost count: 23064
Please forgive me if this is in the incorrect forum.
I am currently trying to use the QuickZip.Zip method to compress files before they are sent out via email. My SMTP sever does not allow “Extreme Compressed” files to be sent or received. Is there a way to adjust the compression ratio to a lower level?
The function call that I am using is:
QuickZip.Zip(sZipPath, true, true, false, sFilePath);
Imported from legacy forums. Posted by Richard (had 3463 views)User (Old forums)MemberSeptember 25, 2007 at 11:53 pmPost count: 23064
I forgot to mention that I am using C#.
Thank you for your help.
Imported from legacy forums. Posted by Richard (had 205 views)Xceed SupportMemberSeptember 26, 2007 at 10:48 amPost count: 5658
When you are using the QuickZip methods, you can adjust the Compression Methods, but not the Compression Levels. However, if you use our FileSystem, you can change the Compression Levels.
Here is a snippet of code that shows how to do the same procedure.
string sZipPath = “path to the zip archive”;
string sFilePath = “path to file to zip”;
AbstractFile zipFile = new DiskFile( sZipPath );
ZipArchive archive = new ZipArchive( zipFile );
archive.DefaultCompressionLevel = CompressionLevel.Lowest;
AbstractFile file = new DiskFile( sFilePath );
file.CopyTo( archive, true );
Imported from legacy forums. Posted by CharlesB (had 224 views)User (Old forums)MemberSeptember 26, 2007 at 1:03 pmPost count: 23064
Thank you for your help. While going through your documentatino, I found the another solution as well. I used ZipArchive to create the zip file. I will give your suggestion a try as well.
string zipFilename = @”C:\TestZip\SourceFile.zip”;
string sourceFolder = @”C:\TestZip\”;
string fileMask = “*.pdf”;
bool recursive = true;
DiskFile zipFile = new DiskFile(zipFilename);
ZipArchive zip = new ZipArchive(zipFile);
zip.DefaultCompressionLevel = CompressionLevel.Lowest;
DiskFolder zipSource = new DiskFolder(sourceFolder);
ZipEvents zipEvents = new ZipEvents();
zipEvents.ItemProgression += new ItemProgressionEventHandler( OnItemProgression );
zipEvents.DiskRequired += new DiskRequiredEventHandler( OnDiskRequired );
zipSource.CopyFilesTo(zipEvents, “Zipping”, zip, recursive, true, fileMask);
Imported from legacy forums. Posted by Richard (had 4110 views)
- You must be logged in to reply to this topic.