ZIP module for Mendix

ZIP module for Mendix

Overview

Why a new ZIP module when two modules are already available in Mendix Marketplace? Quite simply, because these modules cannot handle a folder structure. When you create a ZIP download from a file storage system – like Azure FileStorage, OneDrive or Sharepoint for example – you want to see the folder structure reflected in the ZIP file. But it’s not limited to downloads from a file storage, it can be applied in other ways as well. You can also create a ZIP file with, for example, all documents per employee or per project in separate folders.

Beside the folder structure, another advantage of this ZIP module is the ability to add to an existing ZIP file. This also makes it possible to add files to an already present or uploaded ZIP file.

It works simply via the Java action “Add files to zip”. This action is made available by default in the toolbox of a microflow. The procedure is as follows:

  • First create an empty ZIP file or use an existing ZIP file. All files based on FileDocument are allowed. This allows you to work with your own inheritance and to arrange security appropriately.
  • Now add the appropriate files per folder to the ZIP file using the Java action mentioned above. The root path of the ZIP file is an empty string, if you want to put it in a specific folder you have to define a path separated by forward slashes. It is possible to specify a path that is several subdirectories deep at once e.g. ”employees/john/”.

In time this module will be extended with the possibility to unzip, which also takes into account the folder structure.

Video overview