Eazip
Guides

Create Multi-GB ZIP Archives from URLs with JavaScript

Create multi-GB ZIP archives from remote URLs with JavaScript or React, split large output, and run the work with Eazip Cloud.

Use this workflow when the total archive size is too large for the memory and lifetime of a browser tab. Eazip Cloud fetches the remote URLs and creates the ZIP outside the visitor's device.

Before you start

Create the Cloud archive

export.ts
import { createZip } from '@eazip/core';

export async function downloadLargeArchive(
  urls: string[],
  publicKey: string,
) {
  const result = await createZip({
    strategy: 'cloud',
    publicKey,
    files: urls,
    zipName: 'media-export.zip',
    mode: 'stored',
    maxZipSizeBytes: 2_000_000_000,
  });

  result.downloadAll();
}

Use stored when the prepared archive will be downloaded more than once. Omit mode to use the SDK's stream default. The public key is safe for browser code; secret credentials are not.

Split large output

Set a practical part size for the people and systems receiving the export. The example above requests parts of approximately 2 GB:

zip.download({
  strategy: 'cloud',
  publicKey,
  files: urls,
  zipName: 'export.zip',
  maxZipSizeBytes: 2_000_000_000,
});

The result exposes one zips entry per part. A file larger than the cap remains whole in its own oversized part. See Multi-ZIP splitting.

Keep the job across a reload

@eazip/react persists a created Cloud session and reconnects when the application mounts again. Core applications must save the session handle and call resumeZip() themselves.

Cloud progress is session-based

The browser SDK polls Cloud job state. It does not currently receive Local's per-file or byte progress, so show a processing state rather than a false percentage.

Plan for partial output

Large URL lists should expect an occasional unavailable source. Keep successful files unless the archive is invalid without every item:

zip.download({
  strategy: 'cloud',
  publicKey,
  files: urls,
  failOnUrlError: false,
});

The tray reports a partial result and its skipped count. Cloud does not currently return the per-file error list exposed by Local jobs.

Check policy before changing code

SymptomCheck
Session is rejected immediatelyPublic App file, size, mode, and origin policy
Job cannot fetch sourcesAllowed source hosts, URL lifetime, and server-side reachability
Download is no longer availableSession and output expiry
Output is inconveniently largemaxZipSizeBytes and the receiving system's limits

For jobs driven by URL count rather than total bytes, continue with Zip thousands of URLs with JavaScript. You can also read Sessions and resume or Download S3 or R2 objects as a ZIP.