Listing Incomplete Multipart Uploads - lsparts

Last updated: 2025-05-12 15:11:26

The lsparts command is used to list the generated incomplete multipart uploads.
Note:
If you need to use this command to list multipart upload tasks, when you perform authorization policy, set action to cos:PutBucket.
If you need to use this command to list the fragments of the corresponding file of the multipart upload task, when you perform authorization policy, set action to cos:ListMultipartUploads, cos:ListParts.
For more authorizations, please refer to CAM-Enabled API.

Command format

./coscli lsparts cos://<bucket-name>[/prefix/] [flag]
lsparts includes the following parameters:
Parameter Format
Description
Sample
cos://<bucket-name>
Specify the bucket to access. You can use the bucket alias from the configuration parameters or the bucket name. If using the bucket name, you must also include the endpoint flag.
Access using bucket alias: cos://example-alias
Access using bucket name: cos://examplebucket-1250000000
/prefix/
Specifies a directory (optional).
/picture/
The lsparts command contains the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
Views the usage of this command.
None
--include
Includes specific objects.
None
--exclude
Excludes specific objects.
None
--limit
Specifies the maximum quantity (0–1000) to be listed
None
--upload-id
Upload record ID. When uploading the uploadid, you need to specify the specific file. Only show the fragment information of the file corresponding to the uploadid. If the uploadid is not passed in, show the parts being uploaded under the specified prefix.
Note:
For more information on multipart uploads, see Multipart Uploads.
For other general options related to this command (such as switching buckets or user accounts), see the General Options documentation.

Sample

Listing all incomplete multipart uploads in bucket1 bucket

./coscli lsparts cos://bucket1
The returned information includes the object key (the unique identifier of the object in the bucket), multipart upload ID, multipart upload start time, and total number of incomplete multipart uploads in the bucket. Below is an example:
KEY | UPLOAD ID | INITIATE TIME
---------------+-------------------------------------+----------------------------
test.txt | 1671191183635d2b71b1d68a0** | 2022-01-01T00:00:00.000Z
---------------+-------------------------------------+----------------------------
TOTAL: 1
----------------------------

Listing All Uploaded Fragments of the test.txt File in bucket1 with upload_id 1671191183635d2b71b1d68a0**********

./coscli lsparts cos://bucket1/test.txt --upload-id="1671191183635d2b71b1d68a0**********"
The returned result is as follows. The output information includes: PARTNUMBER (chunk number), ETAG (MD-5 algorithm checksum of the chunk), LastModified (last modified time of the chunk), SIZE (size of each part).
PARTNUMBER | ETAG | LAST MODIFIED | SIZE
-------------+------------------------------------+---------------------------+------------
1 | "58f06dd588d8ffb3beb46ada6309436b" | 2024-12-17T16:34:48+08:00 | 32.00 MB
2 | "58f06dd588d8ffb3beb46ada6309436b" | 2024-12-17T16:34:48+08:00 | 32.00 MB
3 | "58f06dd588d8ffb3beb46ada6309436b" | 2024-12-17T16:34:48+08:00 | 32.00 MB
4 | "58f06dd588d8ffb3beb46ada6309436b" | 2024-12-17T16:34:48+08:00 | 32.00 MB
-------------+------------------------------------+---------------------------+------------
TOTAL: 4
-------------