ZIP
The ZIP file generator accepts an options object, specifying a set of files (themselves defined using file generators) to be compressed into a single ZIP file. The resulting ZIP file may optionally be password-protected.

Options

Option
Description
files
Required; an object specifying a set of filenames mapped to file generators
password
Optional; a string specifying a password to use for encrypting the file
1
{
2
"zip": {
3
"files": FILENAMES_AND_FILE_GENERATORS,
4
"password": PASSWORD
5
}
6
}
Copied!

Example

Liquid
JSON
1
{% action "files" %}
2
{
3
"secure.zip": {
4
"zip": {
5
"password": "opensesame",
6
"files": {
7
"confirmations.txt": "this data is protected with zipcrypto encryption",
8
"image.png": {
9
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
10
},
11
"receipt.pdf": {
12
"pdf": {
13
"html": "<h1>!!</h1>"
14
}
15
}
16
}
17
}
18
}
19
}
20
{% endaction %}
Copied!
1
{
2
"action": {
3
"type": "files",
4
"options": {
5
"secure.zip": {
6
"zip": {
7
"password": "opensesame",
8
"files": {
9
"confirmations.txt": "this data is protected with zipcrypto encryption",
10
"image.png": {
11
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
12
},
13
"receipt.pdf": {
14
"pdf": {
15
"html": "<h1>!!</h1>"
16
}
17
}
18
}
19
}
20
}
21
}
22
}
23
}
Copied!
Last modified 6mo ago
Copy link