How do I download a large object?

更新时间:
复制 MD 格式

Large object downloads can fail when the network is unstable or other exceptions occur — and retrying may not recover the lost progress. Use OSS SDKs or ossutil to download large objects with resumable download support.

Use OSS SDKs

OSS SDKs support resumable download, which records progress in a checkpoint file and resumes from where the last attempt stopped if a part fails.

How it works:

  1. Download progress is recorded in a checkpoint file.

  2. If a part fails, the next attempt resumes from the position recorded in the checkpoint file.

  3. The checkpoint file is deleted automatically after the download completes.

Prerequisites

Before you begin, make sure that you have:

Note

The examples in the SDK documentation use the public endpoint of the China (Hangzhou) region. If you access OSS from another Alibaba Cloud service in the same region, use the internal endpoint instead. For a full list of regions and endpoints, see Regions and endpoints.

Note

To create an OSSClient instance using a custom domain or Security Token Service (STS), see Initialization.

Warning

Do not modify the checksum in the checkpoint file. If the file is corrupted, all parts are downloaded again from the start. If the object's ETag changes or parts are lost or modified during download, the entire object is downloaded again.

For code examples, see Resumable download.

Use ossutil

Run the cp command in ossutil to download a large object.

For details, see Download objects.