Esta página aún no está disponible en su idioma local. Estamos trabajando arduamente para agregar más versiones de idiomas. Gracias por tu apoyo.

On this page

Show all

Listing Objects

Updated on 2023-03-21 GMT+08:00

After objects are uploaded, you may want to view the objects contained in a bucket. Sample code is as follows:

OBSListObjectsRequest *request = [[OBSListObjectsRequest alloc] initWithBucketName:@"bucketname"];
request.maxKeys = [NSNumber numberWithInt:10];
request.origin = @"www.example1.com";
[client listObjects:request completionHandler:^(OBSListObjectsResponse *response, NSError *error) {
    NSLog(@"%d",response.contentsList.count);
}];
NOTE:
  • After you call listObjects, an instance of OBSListObjectsResponse will be returned. This instance contains the response result of the listObject request.
  • In the previous sample code, 1000 objects will be listed, by default.
  • For more information, see Listing Objects.
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback