开发者

Iphone App to Access Secured Web Directory , Need ideas in creating the Directory

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 开发者_StackOverflow中文版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 .


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜