如何使用 Objective-c 在 Amazon S3 上创建文件夹
我知道这是一个以前可能被问过的问题(至少在 Python 中< /a>),但我仍在努力解决这个问题。我将本地文件夹结构和内容与存储在 Amazon S3 存储桶中的内容进行比较。 S3 上不存在但在本地找到的目录将在我的 S3 存储桶中创建。 Amazon S3 似乎没有文件夹的概念,而是识别了一个文件夹作为大小为 0 的空文件。我的问题是,如何通过在 S3 上放置一个空文件(名称与文件夹名称相对应)轻松地在 Objective-C 中创建一个文件夹(我使用 ASIHTTP 进行 get 和 put 事件) ?我想通过将新文件复制到不存在的文件夹来显式创建目录,而不是隐式创建目录。我很感谢你在这方面的帮助。
I know this is a question that may have been asked before (at least in Python), but I am still struggling to get this right. I compare my local folder structure and content with what I have stored in my Amazon S3 bucket. The directories not exisiting on S3, but which are found locally, are to be created in my S3 bucket. It seems that Amazon S3 does not have the concept of a folder, but rather a folder is identified as an empty file of size 0. My question is, how can I easily create a folder in objective-c by putting an empty file (with name correspoding to the folder name) on S3 (I use ASIHTTP for my get and put events)? I want to create the directory explicitly and not implicitly by copying a new file to a non-exisiting folder. I appreciate your help on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当键用作路径名时,
/
字符通常用作分隔符。要在父文件夹foo
中创建名为bar
的文件夹,请创建一个名为/foo/bar/
的键。Amazon 现在有一个 适用于 Objective C 的 AWS 开发工具包。
S3PutObjectRequest
类具有方法-initWithKey:inBucket:
。The
/
character is often used as a delimiter, when keys are used as pathnames. To make a folder calledbar
in the parent folderfoo
, create a key with the name/foo/bar/
.Amazon now has an AWS SDK for Objective C. The
S3PutObjectRequest
class has the method-initWithKey:inBucket:
.