Tech Tip #29

Zip It! Native Apex Zip Library Now Generally Available in Salesforce!

Exciting news for Salesforce developers! The Apex Zip library is now generally available, thanks to the amazing feedback from the IdeaExchange community!

This powerful feature, found within the Compression namespace, allows you to:

Compress and Extract:

Seamlessly compress blobs into Zip archives and extract Zip files directly to blobs within Apex.Optimize Compression: Gain granular control with customizable compression methods and levels.

Handle Multiple Files: Easily zip multiple attachments or documents into a single archive.

Selective Extraction: Extract specific data without unzipping the entire archive.

Key API methods include:

addEntry(String name, Blob data) & addEntry(compression.ZipEntry prototype): for detailed entry creation.- setMethod(compression.Method method): for compression method selection.

– getArchive(): to generate the zipped archive as a blob.Imagine the possibilities! Streamlining document management, simplifying data transfers, and much more.

For example, you can now effortlessly compress email attachments into a single, manageable file.This update empowers developers to build more efficient and robust Salesforce applications.

Read more