使用 Objective C 将文件读取/写入到 Windows Azure 存储
有谁知道有关如何将文件写入 Windows Azure 并使用 Objective C 读取文件的任何好的资源或教程? (适用于 iPhone 应用程序)
谢谢!
Does anyone know of any good resources or tutorials on how to write files to Windows Azure and read the files using Objective C? (for an iPhone app)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
虽然不是您问题的答案,但我将分享如果您选择实现自己的 Objective-C Azure 客户端,请注意 NSMutableURLRequest 将尝试提供帮助并将您添加到请求中的任何标头的名称大写,即: x- ms-date 变为 X-Ms-Date。 Azure 将对此表示拒绝并返回 http 代码 403(错误请求),即使 HTTP RFC 明确声明标头名称将被视为不区分大小写。
这就是我放弃的地方。
While not an answer to your question, I will share that if you choose to implement your own Objective-C Azure client, beware that NSMutableURLRequest will attempt to be helpful and capitalize the names of any headers you add to the request, i.e: x-ms-date becomes X-Ms-Date. Azure will barf on this and return http code 403 (bad request), even though the HTTP RFC explicitly states that header names are to be treated as case-insensitive.
That's about where I gave up.
codeproject 上有一个项目可能会回答您的问题。
使用 Windows Azure 的 iPhone 和 Palm Pre 上的 OneNote
http://www.codeproject.com/KB/aspnet/rinocp.aspx
There is a project on codeproject that would likely answer your questions.
OneNote on iPhone and Palm Pré using Windows Azure
http://www.codeproject.com/KB/aspnet/rinocp.aspx
iPhone 应用程序的用户也是存储帐户的所有者吗?如果是这样,那就去做吧(虽然很抱歉,我没有关于如何在 Objective C 中做到这一点的建议)。
如果没有,请考虑安全模型。如果您要授予用户对存储的访问权限,您要么需要使用具有共享访问签名的 blob(在这种情况下,这应该是微不足道的......您不需要为请求签名而烦恼),或者您需要向用户提供存储帐户的密钥,这通常是一个坏主意。 (这将允许他们读取/写入/删除在那里找到的任何内容。)
Is the user of the iPhone app also the owner of the storage account? If so, go for it (though sorry, I have no advice on how to do this in Objective C).
If not, consider the security model. If you're going to give users access to storage, you'll either need to use blobs with Shared Access Signatures (in which case this should be trivial... you don't need to mess with signing the requests), or you'll need to give users the key to your storage account, which is generally a bad idea. (This would allow them to read/write/delete anything they find there.)
您现在可以下载适用于 iOS 的 Windows Azure 工具包。这将为您提供对 Windows Azure 存储的直接访问或代理访问(代理在部署的角色中运行)。
You can now download the Windows Azure Toolkit for iOS. This will provide you with either direct access or proxy access to Windows Azure Storage (with the proxy running in a Role of your deployment).