Download Multiple Files in One Click Using ZIP Handling in Mendix

Learn how to efficiently download multiple files or documents at once in your Mendix application by bundling them into a single ZIP file. This step-by-step guide walks you through implementing ZIP handling for a seamless user experience.

Downloading multiple files one by one can be frustrating for users. Why not let them grab everything at once with a single click? In this tutorial, we’ll show you how to use ZIP handling in Mendix to bundle multiple documents into one download, step by step.

First create the Mendix application in any version. Here, I am using 9.24.33
-> Open Mendix studio pro
-> Create new app
-> Select Blank web app

Dependencies: –
Community Commons
Zip Handling
install these all modules from Mendix marketplace.

Go to MX Studio Pro and create an entity & give any name like “ZipHandling” & generalized with FileDocument and add your data.

Go to your ZipHandling_Overview page & Take a button name it
Download Zip.

Double-click the Download Zip button, and in the OnClick events, call a microflow. Create a new microflow and name it ACT_DownloadZip.

Here’s the final version of the microflow for downloading multiple documents as a single ZIP file.

Go to ACT_DownloadZip microflow

  1. Take a retrieve activity & select your ZipHandling entity and retrieve data from database. Make sure to apply the following XPath constraint to exclude any ZIP files: [not(contains(Name,’.zip’))]

2. Drag & Drop ZipDocuments java action from ZipHandling module.

3. Open ZipDocuments java action -> Pass the retrieved $ZipHandlingList to the List of document parameter & set empty in the Zip file parameter.

4. Take a create object activity & create a new ZipHandling object.

5. Drag & Drop DuplicateFileDocument java action from community commons module.

6. Open the DuplicateFileDocument Java action, pass $DownloadZip to the File to clone parameter, and $NewZipHandling to the Clone target parameter.

7. Take a Download File activity and select the $NewZipHandling object for the File document parameter.

Now Run the application & test it.

Download Zip & Extract them.

Conclusion:

I hope this article has helped you understand How to Use Zip Handling for downloading multiple files in Mendix.

Thanks for reading this! See you in the next blog post.

Learn more Download Multiple Files in One Click Using ZIP Handling in Mendix

Leave a Reply