Skip to content

ZIP Add File

Type: zip-add-file  ·  Package: ZIP Activities v1.0.5  ·  Output: string

Adds a file to an existing ZIP. If the ZIP does not exist, it creates it. Useful for accumulating files in the same ZIP throughout a process (for example, inside a loop).

Adds the file filePath to the ZIP zipPath. By default it keeps its original name, at the root of the ZIP; with entryName you can rename it or place it in a sub-folder ("2026/invoice_001.pdf").

  • If the ZIP does not exist, it is created (along with its folder, if needed).
  • If an entry with that name already exists, it is replaced: repeating the activity with the same file does not duplicate it.
  • The original file is neither changed nor moved.
  • Performance: each call opens and rewrites the ZIP, which is loaded into memory. For many files or large ZIPs, gather them in a folder and use ZIP Compress once.
ParameterTypeDefaultDescription
zipPathstring—Path of the ZIP file (existing or new), including its folder.
filePathstring—File to add.
ParameterTypeDefaultDescription
entryNamestringfile nameName inside the ZIP. It may include sub-folders separated by / ("invoices/001.pdf").

Returns the ZIP path (zipPath, as you gave it), handy to chain it into the next activity. Since version 1.0.5 the output is declared and the Designer offers where to store it.

MessageCause and fix
File to add not found.filePath does not exist. Check it with File Exists.
End of Central Directory record could not be found.zipPath exists but is not a valid ZIP (corrupted or another kind of file). Use another path or delete it first.
The process cannot access the file '…' because it is being used by another process.The ZIP or the file is open in another program.
'zipPath' is required. / 'filePath' is required.The parameter’s expression evaluated to null.

Accumulate the generated PDFs in a single ZIP and send it at the end:

For Each items = customers itemVariable = customer
└─ activities:
... generate the customer's PDF in pdfPath ...
ZIP Add File zipPath = "C:/outbox/batch.zip" filePath = pdfPath entryName = "customers/" + fileName(pdfPath)
SMTP Send ... subject = "Document batch" attachments = arr("C:/outbox/batch.zip")