tr Skip to content
Black Friday FlowMattic for life, 12 payments of $33.25 Or $399 once. Nothing added for splitting Ends in --Days --Hrs --Min --Sec See the deal

Create ZIP Files Automatically: Bundle, Extract and Edit Archives

FlowMattic ZIP Archive module: a PDF and a CSV report are bundled into one ZIP saved to the Media Library and sent as a single download link.

When a workflow produces several files, such as invoices, reports, form uploads or product images, you often want to create ZIP files automatically and send one download instead of many. FlowMattic’s ZIP Archive module does that as a workflow step, and it works the other way too: it can open a ZIP that arrives, list what is inside and put each file in your Media Library.

It suits agencies delivering client packs, shops bundling digital goods, and operations teams that receive archives from suppliers. Everything happens on your WordPress server.

What is the ZIP Archive module?

ZIP Archive is a built-in action app in the FlowMattic workflow builder: “Create, extract, and manage ZIP archives. Bundle files from URLs into ZIP archives and save to WordPress media library.” It appears with the other data tools when your server’s PHP includes the ZipArchive class. It has five actions:

  • Create ZIP Archive from file URLs.
  • Extract ZIP Archive into the Media Library.
  • List ZIP Contents without extracting.
  • Add Files to ZIP in an existing archive.
  • Remove Files from ZIP in an existing archive.

How to create ZIP files automatically

  1. Add a step and choose ZIP Archive, action Create ZIP Archive.
  2. In File URLs, enter or map the files: a comma-separated list, a JSON array of URLs, or a JSON array of objects with a url key.
  3. Set Archive Name. The .zip extension is added if you leave it off.
  4. Optionally set Base Folder (Optional) to put every file inside a folder in the archive.
  5. Test the step and map media_url into an email, a download link or the next step.
FlowMattic workflow builder showing the ZIP Archive step with the Create ZIP Archive action and the File URLs, Archive Name and Base Folder (Optional) fields.
The Create ZIP Archive action with file URLs, an archive name and a base folder inside the archive.

Each file is downloaded to your server, added to the archive, and the finished ZIP is saved to the Media Library. If a download fails, the rest still go in and the failures are listed in failed_files. Files with the same name are kept apart as report.pdf, report-1.pdf and so on.

Actions, fields and output

ActionFieldsReturns
Create ZIP ArchiveFile URLs, Archive Name, Base Folder (Optional)media_id, media_url, file_name, file_count, file_size, files_added, failed_files if any
Extract ZIP ArchiveZIP File URL, Password (Optional)total_files and extracted_files, each with file_name, relative_path, media_id and media_url
List ZIP ContentsZIP File URLfiles with name, size, compressed size, modified date and whether it is a folder; total_entries, total_size, compression_ratio
Add Files to ZIPZIP File URL, File URLs to Add, Base Folder (Optional)A new archive in the Media Library, total_files, files_added
Remove Files from ZIPZIP File URL, File Names to RemoveA new archive in the Media Library, files_removed, not_found

Use cases

Monthly client report packs

An agency generates a PDF report and a CSV export for each client, zips them into a folder named after the month, and emails one link.

Scheduler → PDF Template → CSV Creator → ZIP Archive (Create) → Send email

Bundle a customer’s uploads

A quote form accepts several attachments. Zip them into one archive named after the submission so the team downloads one file instead of hunting for each upload.

Form submission → ZIP Archive (Create) → Slack: post the link

Unpack supplier product images

A supplier sends a ZIP of product photos. Extract it, and each image lands in the Media Library with its own URL, ready to attach to products.

Webhook (ZIP URL) → ZIP Archive (Extract) → Iterator → WooCommerce: update product

Check an archive before you accept it

List the contents of an uploaded ZIP and use a Filter to reject it when total_entries is zero or the expected file is missing, before anyone opens it.

Form submission → ZIP Archive (List) → Filter → Email confirmation

Grow an archive over the week

Each paid invoice is added to the current archive with Add Files to ZIP; store the latest media_url in a table so the next run adds to it. At the end of the week the bookkeeper gets one file.

WooCommerce: order paid → WP Tables: find record → ZIP Archive (Add) → WP Tables: update record

Offsite copies of generated files

Zip the day’s generated documents and upload the archive to a backup server over FTP or SFTP.

Scheduler → ZIP Archive (Create) → FTP / SFTP: Upload a file

Tips and gotchas

  • Get the URL list into shape. File URLs accepts a comma-separated list, a JSON array of URLs or a JSON array of objects with a url key. The help text suggests PHP Array Convert Array to List when you need the comma-separated form. URLs under another key, such as link, are skipped, so reshape those first.
  • Add and Remove make a new archive. The original ZIP is not changed; the updated one is saved as a new Media Library item with a new media_url.
  • Removal needs exact paths. Use the names exactly as List ZIP Contents shows them, including folders, such as documents/file.pdf.
  • Extracting follows Media Library rules. Each file is added through WordPress’s normal upload handling, so a file type your site doesn’t allow comes back with an error in extracted_files instead of a URL.
  • Passwords are for extracting only. Password (Optional) opens protected archives; the module does not create password-protected ZIPs.
  • Media Library files are public. Anyone with the URL can download them. Don’t zip private documents there for sharing.
  • Large files take time. Each download is allowed up to 300 seconds, and big archives use disk space in your uploads folder while they are built.

Related features

FAQ

How do I create a ZIP file in WordPress automatically?

Add the ZIP Archive step to a FlowMattic workflow, choose Create ZIP Archive, and map the file URLs from earlier steps. Each run builds the archive and saves it to your Media Library.

Can it extract a password-protected ZIP?

Yes. Enter the password in Password (Optional) on the Extract ZIP Archive action. If the password is wrong or the archive is damaged, the step returns an error explaining it couldn’t extract the files.

Where are the ZIP files stored?

In your WordPress Media Library, like any other upload. Temporary working files are cleaned up after each run.

Why don’t I see the ZIP Archive app?

The module only registers when PHP’s ZipArchive class is available. Ask your host to enable the PHP zip extension and it will appear in the app list.

ZIP Archive is one of the built-in file tools in FlowMattic. See the plans and create ZIP files automatically instead of downloading and zipping by hand.

More from the blog