好的,我看到这个和这个文档告诉亚马逊是平面文件系统,并且要创建/获取/设置文件夹,必须使用 Delimiter='/' 和前缀。
但我没明白,我的意思是我不能写代码。所以我有一个存储桶和一个包含一些文件的文件夹,我想要这些文件的列表
所以我尝试了, bucket/folder
所有这些都失败了。/bucket/folder/
bucket/folder/
如果我只尝试bucket
,它工作正常
S3ListObjectsRequest *getListObjectsRequest= [[S3ListObjectsRequest alloc] initWithName:@"bucket"]; // tried also here bucket/folder , /bucket/folder/ , bucket/folder/
S3ListObjectsResponse *getListObjectsResponse = [self.s3 listObjects:getListObjectsRequest];
//test to see inside of the folder
NSArray *objectsinamazon = [self.s3 listObjectsInBucket:@"bucket"]; //as I said I tried bucket/folder , /bucket/folder/ , bucket/folder/ all od this fails.
NSLog(@"array is %@",objectsinamazon);
S3ListObjectsResult *listObjectsResults = getListObjectsResponse.listObjectsResult;
for (S3ObjectSummary *objectSummary in listObjectsResults.objectSummaries) {
NSLog(@"Bucket Contents %@:",[objectSummary key]);
//get last modified date of file by using meta data
S3GetObjectMetadataRequest *getMetadataRequest = [[S3GetObjectMetadataRequest alloc] initWithKey:[objectSummary key] withBucket:@"bucket"];
S3GetObjectMetadataResponse *getMetadataResponse = [self.s3 getObjectMetadata:getMetadataRequest];
}
}
我要求确切的语法(代码)向bucket/folder
亚马逊 s3 发送请求