Skip to content

downloadFile

function downloadFile(options: DownloadFileOptions): Promise<TransferReceipt>;

Defined in: src/client/operations.ts:138

Downloads a single remote file to a local path.

The remote provider is resolved from source.profile.provider. The local destination path is created (including parent directories) on demand.

ParameterTypeDescription
optionsDownloadFileOptionsFriendly download options.

Promise<TransferReceipt>

Receipt produced by the underlying transfer engine.

import {
createS3ProviderFactory,
createTransferClient,
downloadFile,
} from "@zero-transfer/sdk";
const client = createTransferClient({ providers: [createS3ProviderFactory()] });
await downloadFile({
client,
localPath: "./tmp/snapshot.tar.gz",
source: {
path: "snapshots/2026-04-28/snapshot.tar.gz",
profile: {
host: "snapshots", // S3 bucket
provider: "s3",
s3: { region: "us-east-1" },
},
},
});