Zip / Unzip
Packs several files into one zip — to attach to an e-mail or upload in one go — or unpacks a zip you received so each file can go to its own step.
Parameters
| Name | Shown for | Default | Description |
|---|---|---|---|
Operation (operation) | all | Zip files | zip or unzip. |
Files (files) | zip | — | One file or a list of files from earlier steps: e-mail attachments ({{ $trigger.attachments }}), File or Convert to File results, or {{ $nodes['Unzip'].files }}. Up to 1,000 files and 1 GB in total. |
Zip file name (fileName) | zip | archive.zip | The name of the new file; .zip is added when missing. Expressions work, e.g. invoices-{{ $today }}.zip. |
Compression (compression) | zip | Smallest file | optimal, fastest, or none (store only — quickest for photos, videos and PDFs, which barely shrink). |
Zip file (file) | unzip | — | The zip to unpack. |
Only files matching (pattern) | unzip | all files | Unpack only matching files. * matches any text, ? one character; separate patterns with commas: *.csv, reports/*.pdf. A pattern without a folder matches the file name in any folder. |
Largest total size (MB) (maxSizeMb) | unzip | 100 | Stop if the unpacked files add up to more than this, 1–1024 MB. |
Most files (maxFiles) | unzip | 1000 | Stop if the zip holds more files than this, 1–10,000. |
Ports
| Port | Description |
|---|---|
main (input) | The step(s) it runs after. |
output | The zip (zip) or the unpacked files (unzip). |
Output
Zip
{ "file": { "fileName": "archive.zip", "contentType": "application/zip", "…": "…" }, "fileName": "archive.zip", "fileCount": 3, "size": 48213 }
Use {{ $nodes['Zip / Unzip'].file }} as an attachment or in the File step.
Unzip
{
"files": [ { "fileName": "rows.csv", "contentType": "text/csv", "…": "…" } ],
"entries": [ { "path": "data/rows.csv", "name": "rows.csv", "size": 1290, "contentType": "text/csv" } ],
"count": 1,
"totalSize": 1290,
"skipped": []
}
files— the unpacked files, in the zip's order, ready for Loop, Parse CSV, the File step and so on.entries— the same files' path inside the zip, name, size and type (same order asfiles).skipped— entries that were left out, with the reason.
Example
Process every CSV in a zip that arrives by e-mail:
- Email Trigger
- Zip / Unzip — Operation Unzip a file, Zip file
{{ $trigger.attachments[0].file }}, Only files matching*.csv - Loop over
{{ $nodes['Zip / Unzip'].files }}→ Parse CSV with{{ $item }}
Notes
- Zip bombs are stopped before anything is unpacked. The step checks the zip's own table of contents first: the number of files, their total unpacked size, and how much each file expands — a file that would grow more than 200 times its packed size (and past 1 MB) is refused. While unpacking it also counts the real bytes, so a zip that misstates its sizes stops at the limit too.
- Unsafe paths are skipped. Entries whose path leads outside the zip's folder (
../,/etc/…,C:\…) are left out and listed inskipped. Folders themselves aren't returned; each file's folder is inentries[].path. - Password-protected zips aren't supported.
- Large files don't sit in memory: stored files are read and written as streams, small unpacked files (up to 1 MB each, 4 MB together) are returned directly, and larger ones are kept in temporary storage and returned as file references — every step that takes a file accepts them.
- Only
.ziparchives are supported (not.rar,.7zor.tar.gz).