Zip or Unzip Files in Salesforce
Hello Trailblazers,
Though Salesforce provides wide variety of out of the functionalities, in house solutions – creating a zip file or unzipping it in apex is still something that is not provided by Salesforce. For one of my work I came across situation where I wanted to zip multiple files together and I couldn’t find anything through Salesforce documentations. After spending some time over internet, I came across few workarounds which can be used to create zip files in Salesforce.
Listing down three of them for three different platform solutions.
Zippex Utility
- addFile
- removeFile
- getFile
- containsFile
- getFileNames
- getFileInfo
- getZipArchive
- renameFile
- unzipAttachment
JSZip
We just saw how you can zip/unzip files using apex-based utility. Since there are some apex transactional limitations, you can switch to client side and use JSZip – javascript library to create zip files within Salesforce. Since you execute these operations on client side you can get rid of Salesforce governor limits.
You have to download script file from GitHub location and include it on your client component. Just like Zippex, JSZip also support multiple operations along with reading local file or file at some remote location.
JSZip can help you to tackle apex limitations but it does have some limitations regarding browser compatibility, encoding support and issues with performance of your application.
File ZIPO
Apex has some limitations, JSZip also has some limitations then how to get stable solution for your product ? In this situation you can go for paid tools which are available in the market and can help you achieve your resolution.
File ZIPO is a Salesforce native app that integrates your Salesforce org with the most-popular external cloud storage platforms such as Google Drive, OneDrive, Dropbox etc.
Along with file operations you can easily connect your Salesforce org with multiple cloud platforms. You can Sync files, merge files , backup your files to cloud storage or add files from cloud to Salesforce directly with File ZIPO.
This is paid app but I found it better than other apps available in terms of functionalities it is providing.
Comments
Post a Comment