Let Bubble users download many files as one ZIP

Bubble has no built-in way to download a list of files as one ZIP. How to add a Download all button with the API Connector and one call, without a server or plugin.

A list of files in a Bubble app downloaded with one button as a ZIP

Bubble can show a list of files, but there is no built-in action to download them all at once. Plugins exist, but many run in the browser, which struggles with large files and phones. The ZIP Files API builds the ZIP on the server and gives you one link.

1. The API Connector call

Create a call named Make ZIP, used as an Action, data type JSON:

  • POST https://api.justapi.tech/v1/files/zip
  • Header Authorization: Bearer ak_live_..., private.
  • Body:
{
  "sources": <sources>,
  "options": { "names": <names>, "filename": "<zip_name>" }
}

sources and names are parameters you will fill with JSON arrays, so leave them without quotes. Initialize the call with a sample like [{"url":"https://example.com/a.pdf"}] and ["a.pdf"].

2. Build the lists in a workflow

On the "Download all" button:

  1. Make ZIP, with:
    • sources: [ + Repeating group's List of Files:each item's file:format as text + ], where the format-as-text content is {"url":"https:This file's URL"} and the delimiter is a comma.
    • names: the same idea, with content "This file's name".
    • zip_name: something like Project-123.zip.
  2. Open an external website: Result of step 1's result url.

The browser downloads the ZIP.

3. Things to watch

  • Bubble file URLs start with //. Add https: in front, as above.
  • Private files in Bubble need signed URLs; a URL the API cannot download fails the whole call with invalid_source and the index of that file, at no charge.
  • Names with quotes break the JSON. Use :find & replace to remove " from names, or name files by their ID.
  • Limits: 100 files and 200 MB per ZIP. For bigger sets, make one ZIP per page of the list.

Why server-side

The files never pass through the user's phone until the ZIP is ready, so it works on slow connections. Already-compressed files like photos and PDFs are stored without recompressing, so even large sets are quick.

Cost

$0.003 per ZIP at the first tier. Try the result format with the free ZIP tool.