File

Zip Multiple Files

Use the zipAsync and zipSync methods to bundle multiple files into a single ZIP archive stored in a destination namespace.
This is useful for downloading, sharing, or archiving multiple assets in one file.


trelae.zipAsync(options){ status, operationId, file, meta }

Enqueue a ZIP creation job. Returns immediately with:

  • status — always "queued"
  • operationId — string ID for tracking
  • file — placeholder File instance
  • meta — raw metadata for the placeholder file

Use this when you don’t want to block until the ZIP is ready.

Example


trelae.getZipStatus(operationId){ id, type, status }

Fetch the current status of an async ZIP job.
Possible statuses: "queued", "processing", "completed", "failed".

Example


trelae.zipSync(options){ status, operationId, file, meta }

Convenience wrapper: enqueues a ZIP and polls until it is "completed".
Returns once the ZIP is uploaded and ready.

Example


Parameters

NameTypeRequiredDescription
fileIdsstring[]Array of file IDs to include in the archive
namespaceIdstringNamespace where the ZIP will be stored
zipNamestringCustom name for the ZIP (default: auto-generated)
locationstringFolder path inside the namespace (default: root)
pollobjectFor zipSync: { intervalMs, timeoutMs }

Notes

  • All files in fileIds must be accessible to your API key’s namespace permissions.
  • For large or many files, prefer zipAsync + getZipStatus or zipSync to handle long-running jobs.
  • Once completed, the ZIP behaves like any other file in Trelae: it can be downloaded, moved, copied, or deleted.