Create ZIP archive

Syntax

zipArchive(
    name: "archive.zip",
    entries: [
        zipEntry(
            contents: binary("folder/hello.txt", "Hello world!"),
            comment: "Index file.",
            time: now(),
            compress: true
        ),
        binary("folder/data.json", $jsonData),
        ...
    ],
    comment: "Project data...",
    compress: true,
    level: 9,
    charset: "utf-8")

Description

Constructs a ZIP archive consisting of the specified files.

Parameters

Name Type Description Mandatory Default
name String Name of the file yes -/-
entries List of ZIP entries or binary values List of files to be packed into the archive. These can either consist of ZIP entries or directly represent binary values. To represent a folder structure in the archive, the names of the files must consist of a path separated by "/". Binary values in the content only need to be explicitly packed into a ZIP entry if additional information such as comments or compression is to be customized per file. yes -/-
comment String Comment about the content. Will be stored in the archive, but has no further meaning. no -/-
compress Boolean value Whether the contents should be compressed. no true
level Number Strength of compression (0 to 9) no 9
charset Character string The character set used for filenames "utf-8"

Return value

Type: binary value

A representation of a ZIP file. In the above example, it is an archive named "archive.zip" consisting of the files "hello.txt" and "data.json" in the subfolder "folder". If the value is used as a return value of a custom action of a button, the data can be offered to the user as a download.