如何使用AWS的iOS SDK来删除文件夹,并在侧面斗所有对象?并在、如何使用、侧面、文件夹

2023-09-11 23:49:22 作者:美是姐的本性

我上传的对象到Amazon S3的iPhone使用AWS的iOS SDK中,有时会出现错误,其中一些对象上传,其余的都没有上传。我创建桶和内斗我已经创建的文件夹中,我有我的存储对象。我想删除文件夹及其所有对象。谁能帮我?

I am uploading objects to amazon s3 using AWS iOS SDK in Iphone, sometime error occurs and some of the objects are uploaded, remaining are not uploaded. I have created bucket and inside bucket i have created folder in which i have store my objects. I want to delete folder and all its object. Can anyone help me?

推荐答案

首先,没有这样的东西在S3中的文件夹。大多数S3客户端(包括AWS Web控制台)显示他们的文件夹只是为了方便(分组东西),但实际上,你看作为一个文件夹名什么是仅仅是preFIX。

First of all, there is not such thing as "folders" in S3. Most S3 clients (including the AWS web console) show them as folders only for convenience (grouping stuff), but in fact, what you see as a "folder name" is merely a prefix.

存在这么说,我给你的建议是使用 listObjectsInBucket API调用,传递你的文件夹名称为preFIX在S3ListObjectsRequest参数。 当你获得的所有键(文件名包括preFIX)匹配了preFIX,使用 deleteObjects API调用,传递在S3ListObjectsRequest参数的关键。

Being that said, my suggestion to you is using the listObjectsInBucket API call, passing in your "folder name" as prefix in the S3ListObjectsRequest parameter. When you have obtained all the keys (file names including prefix) matching that prefix, use the deleteObjects API call, passing in the keys in S3ListObjectsRequest parameter.

有关文件夹/ preFIX和删除的东西更多详细信息,请参阅以下相关链接: Delete文件,目录和水桶在Amazon S3中的Java 在AWS论坛上关于这方面的主题

For more details on folder/prefix and deleting stuff, please see these related links: Delete files, directories and buckets in amazon s3 java Thread on AWS forum regarding this subject