Skip to main content
Skip table of contents

createZip

Creates a variable with a new ZIP archive File as its value.

Child commands

  • addZipItem
    Required. At least one item has to be added into the newarchive. While there is no specific maximum amount of these child commands, the file size of the archivemay not exceed 256 megabytes.

Attributes

var

Required

Value type

EL-evaluated

Yes

String

No

Defines the name of the variable that will hold the ZIP archiveFile value.

fileName

Required

Value type

EL-evaluated

No

String

Yes

Defines the name of the created File.

If undefined, theFile's name will be the value of var with the ".zip" suffix.

title

Required

Value type

EL-evaluated

No

String

Yes

Defines a title for the created File.

If undefined, theFile's title will be the value of var.

compression

Required

Value type

EL-evaluated

No

Integer

Yes

Defines the level of the archive's compression. The value can beany number from 0 to 9, 0 being no compression and 9 being the highest level of compression. Providing any other value will produce an error.

Note that higher compression levels cause the creation of the archive to take longer, which may or may not be notable as this command is being evaluated.

If left undefined, a default compression level intended to be a good compromise between speed and compression is used.

keepContextItems

Required

Value type

EL-evaluated

No

Boolean

Yes

Defines if the Files added to the archive throughaddZipItem commands are removed from the variable context. A value of trueprevents this from happening.

Note that this removal only affects Files that have their own variables in the context - Files stored in Collections, for example, will not be affected.

If undefined, value of false is used, causing the archived File variables to be removed.

Examples

The createZip command with its addZipItem children can come useful if your logic's output consists of several files, as putting them into a single ZIP file lessens the amount of files to upload, or for users to download, from however many into just one. Packing up a Collection of PDF files into a ZIP could work as follows:  

CODE
<createZip var="docs"><forEach value="${resultPDFs}" var="resultPDF"><addZipItem value="${resultPDF}"> 
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.