如何使iOS应用程序充当Web服务器 [英] How to make iOS application act as web server

查看:170
本文介绍了如何使iOS应用程序充当Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个iPhone应用程序,它将在应用程序文档目录中包含一些文件(图像,音频和视频)(注意:文件位于文档目录中,而不是资源或主程序包)。



我想创建一个唯一的URL,允许用户从Mac,智能手机等其他设备上的浏览器下载这些文件(来自apps文档目录)。 p>

因此可能简而言之,iOS应用程序充当Web服务器,允许下载应用程序的文件。



如何实现这一点?

解决方案

尝试 CocoaHTTPServer - 您可以使用它来提供一个页面,其中包含文档目录中文件的下载链接。 (并自己提供文件)


I have developed an iPhone application which will have some files (images, audio & video) in applications document directory (Note: File are in documents directory & not resources or main bundle).

I want to create a unique URL which will allow user to download these files(from apps document directory) from browser on other devices as Mac, smartphones, etc.

So may be in short make iOS application act as web server allowing to download application's files.

How to achieve this?

解决方案

Try CocoaHTTPServer - you can use that to serve up a page with download links to files in the documents directory. (and to serve up the files themselves)

这篇关于如何使iOS应用程序充当Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆