用于访问安全 Web 目录的 Iphone 应用程序,需要创建目录的想法
我正在构建一个 Iphone 杂志应用程序。我需要该应用程序访问托管在 Apache 或 IIS 上的安全 Web 文件夹/目录,以下载 HTTP 文件夹内的 pdf mag 文件。
传统的方法是使用 .htaccess 为 Apache 创建受密码保护的文件夹吗? IIS 怎么样?
Iphone App 访问文件夹的传统方式是什么?有 Xcode 的例子吗?
谢谢 。
I am building an Iphone Magazine App . I need the app to access a secured web folder/directory hosted on probably Apache or IIS to download pdf mag files inside the HTTP folder .
Is the conventional way of doing this by using the .htaccess to create a password protected folder for Apache ? How about IIS ?
And a conventional way for the Iphone App to access the folder ? Any Xcode example ?
Thanks .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,传统的方法是使用 mod-autoindex (Apache) 来公开目录。该目录实际上应该位于服务器根目录之外,以给予其某种保护。
然后,您将编写一个小型 CGI(PHP、java servlet、ruby 等),它强制执行某种客户端身份验证方案,只有这样,它才会为您提供该目录中内容的一个很好的列表。它还可以负责将下载流发送到特定的 pdf。只有此脚本有权查看该目录中的内容。
因此,这当然并不详尽,因为它涉及安全性,但它应该为您指明正确的方向。这实际上取决于您需要该目录的安全程度。
Xcode (Cocoa) 可以轻松访问任何远程 URL 信息,无论您采取何种方法。查看 NSURLConnection 和本指南:
http://developer .apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html
Well, the conventional way would not be to expose the directory, using mod-autoindex (Apache). The directory should actually be outside the server root, to give it some semblance of protection.
Then you would write a small CGI (PHP, java servlet, ruby, etc), which enforces some sort of client-authentication scheme, and only then would it give you a nice list of what is in that directory. It could also be responsible for sending the download stream to a particular pdf. Only this script would have permission to view what's inside that directory.
So that's certainly not exhaustive as it pertains to security, but it should point you in the right direction. It really depends on how secure you need this directory.
Xcode (Cocoa) can easily access any remote URL information, regardless of the approach you take. Check out NSURLConnection and this guide:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html