tencent cloud

Cloud Object Storage

문서Cloud Object Storage

List Objects

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-02-02 16:54:12
AI 번역

Introduction

This document provides an overview of APIs related to list object operations and sample SDK code examples.
API
Operation Name
Operation Description
List Objects
List partial or all objects in this bucket.

List Objects

Feature Overview

List partial or all objects in this bucket (List Object).

Example Code

// Bucket name, which consists of bucketname-appid (appid must be included), can be viewed in the COS console. https://console.tencentcloud.com/cos5/bucket
let bucket = "examplebucket-1250000000";

let request = new ListObjectsRequest(bucket);
// Obtain all files in the dir directory: request.prefix = "dir/"
// Obtain all files in the root directory: request.prefix = "";
request.prefix = "dir/"
try {
let result = await CosXmlBaseService.default().listObject(request)
// result includes http headers, etc.
} catch (e) {
// Exception
// Processing
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백