ZIP

Creates a ZIP archive containing a given file or files.

If the optional password parameter is present then the archive will be password protected.

The function can also accept an array of file objects as its first argument. The file object must contain either contents or base64encoded contents, a file name and optionally can specify the created_at date in ISO8601 format.

If the output of the ZIP function is being included in event data, it should be wrapped in the BASE64_ENCODE function to avoid errors - e.g. BASE64_ENCODE(ZIP(my_action)).

Syntax 

ZIP(fileContentsOrFilesArray, [filename], [password])

Usage examples 

Example 1

Formula

ZIP(file_contents, "file_name", "optional_password")

Example 2

Formula

ZIP(file_contents_1, "file_name_1", file_contents_2, "file_name_2", "optional_password")

Example 3

Input

1
{
2
"zip_files": [
3
{
4
"contents": "file_contents1",
5
"created_at": "2023-01-11T15:06:18+00:00",
6
"name": "file1.txt"
7
},
8
{
9
"base64encodedcontents": "ZmlsZV9jb250ZW50czI=",
10
"created_at": "2023-01-11T16:06:18+00:00",
11
"name": "file2.txt"
12
}
13
]
14
}

Formula

ZIP(zip_files, "optional_password")

Sample Actions 

New Page
Transform
ZIP

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Transform
My Action
Transform
ZIP

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?