如何使用http / ftp上传文件到iphone / ipad? (如ifile,goodreader) [英] How do I upload files using http/ftp to iphone/ipad? (Eg. ifile, goodreader)

查看:1423
本文介绍了如何使用http / ftp上传文件到iphone / ipad? (如ifile,goodreader)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么好的建议上传文件到设备?我见过很多应用程序在80或8080上创建一个HTTP服务器来上传文件。这是否意味着我也必须实现一个服务器?



是否有任何第三方库? (最好是开放源代码和非GPL)编辑:我要升级在企业环境中的特定设备的应用程序中的文件,所以iPad的拉文件中央服务器也是一种选择。但我不得不发送消息到这些ipad来告诉他们去获取这些文件。

我假设你想要的是一种自动更新。一个应用程序按照服务器的顺序做一些事情,而不需要用户的手动操作。



我不知道iOS的企业许可证特定功能。但我相信没有这样的企业特定的API。而且据我所知,自动更新几乎是不可能的。因为,


  1. 自动更新没有系统级支持。 (但是?)

  2. 因此,应用程序中应该实现消息传递和抓取功能。

  3. 但是没有应用程序保证长时间在后台运行。

  4. 此外,用户还可以随时关闭任何应用程序。

  5. 没有办法将消息发送到未运行的应用程序。 / li>

    $ b
    $ b 即使您可以发送,也无法处理每个客户端的服务器。如果你的应用程序正在运行,发送消息或命令他们获取或做任何事情只是一个简单的工作。问题是没有固定的方法来强制他们永远活着。甚至在操作系统重启或异常终止的情况下。



    然而,替代。只需将应用程序注册为Skype等VOIP应用程序即可。操作系统不保持应用程序运行,但会监视特定的套接字端口,并会在套接字收到一些消息时唤醒您的应用程序。有关更多详细信息,请参阅此处: http://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5- SW15



    在AppStore中,使用VOIP作为自动更新等其他用途的应用程序不会被传递,但您无需担心。其他方式发送消息到设备,而不运行应用程序是推送通知 。这是系统级支持的功能。但这不是为了指挥应用程序。这是旨在发送文字信息。所以如果你的应用程序没有运行,消息将显示给用户。但是,您可以引导用户通过发送推送通知来启动应用程序。



    作为最终选项,您可以向Apple请求某些功能以用于企业环境。如果您的公司足够大以获得企业许可证,那么Apple会认真考虑您的功能请求。
    $ b




    如果您决定使用VOIP方法,对不起,我不能再帮你了。我没有实施这种应用程序的经验。但它不应该这么难。

    然而困难的部分是服务器。它绝对需要定制的服务器程序,保持TCP / IP连接。普通的HTTP服务器不能使用。由于HTTP本身被设计为不保持TCP / IP连接。你必须从头开始构建这种服务器。您必须处理较低级别的TCP / IP传输。



    这种服务器有几种解决方案(免费/商业),但没有一个流行,因为这种服务器经常需要完全定制。所以没有什么可以重复使用或共享的。



    不过,我相信这是您的应用程序最适合的实现。



    < hr>

    如果您只有在应用程序运行时才能满足自动更新,则可以通过定期从客户端轮询服务器状态来对其进行归档。



    这很容易实现,因为您可以为此使用常规的HTTP服务器。客户端定期连接并从中央服务器下载最新的更新。如果有新的更新,只要抓取并做你想做的。而应用程序启动,只是首先检查更新。防止所有操作,直到更新应用。

    这是常规的方式。大多数应用程序都是用这种方法构建的。在这种情况下,你不需要实现服务器或硬件。



    然而,更新的速度取决于轮询周期。






    (编辑)

    我不在乎私有API。因为你的app不适合AppStore,所以你可以自由使用私有API。 (这与jail-breaking有所不同,隐藏的功能太多了)我不知道私有API,但是可能有一些API支持keep - 应用程序的活动。
    然而,这种反向工程是非常痛苦的,除非你天生就是黑客。

    Is there any good advice on uploading files to the device? I've seen many apps create a http server on 80 or 8080 to upload files. Does that mean I have to implement a server too?

    Are there any 3rd-party libraries? (Preferably open-source and non-GPL)

    EDIT: I am going to upgrade files in the app for specific devices in a corporate environment, so the ipad pulling files from a central server is also an alternative. But I would have to send messages to these ipads to tell them to fetch those files.

    解决方案

    I assume what you want is a kind of automatic update. An app do something by order from server without user's manual operation.

    I don't know enterprise-license specific feature of iOS. But I believe there's no such enterprise-specific APIs. And as I know, automatic update is almost impossible. Because,

    1. There is no system-level support for automatic update. (yet?)
    2. So messaging and fetching feature should be implemented in app.
    3. But no app is guaranteed to run in background for long time.
    4. And also user can turn off any app at any time.
    5. There is no way to send message to an app which is not running.
    6. Even you can send, there is no way to address each client form the server.

    If your app is running, sending message or commanding them to fetch or do anything is just a simple work. The problem is there is no regular way to force them always keep alive. Even under situations like OS reboot or abnormal termination.

    However there is an alternative. Just registering app as VOIP app like Skype. OS does not keep the app running too, but will monitor specific socket port, and will wake your app when the socket receives some message. For more details, see here: http://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW15

    In AppStore, an app using VOIP for other purpose like automatic update will not be passed, but you have no need to concern about it.

    And other way to send message to device without running app is push notification. This is a feature supported in system-level. But this is not designed to commanding app. This is designed to send textual message. So If your app is not running, the message will be displayed to user. However, you can guide the user to start the app by sending push notification.

    As a final option, you can request some feature to Apple for enterprise environment. If your company is big enough to get an enterprise license, Apple will consider your feature request seriously.


    If you decided to use VOIP method, I'm sorry I can't help you any more. I have no experience of implementing this kind of app. But it should not so hard.

    However hard part is server. It definitely require custom server program which keeps TCP/IP connection. Regular HTTP server cannot be used. Because HTTP itself is designed as not to keep TCP/IP connection. You have to build this kind of server yourself from scratch. You'll have to handle lower level TCP/IP transmissions.

    There are a few solutions(both of free/commercial) for this kind of server, but none of are popular because this kind of server regularly needs full customization. So there's nothing to re-use or share.

    However I believe this is most suitable implementation for your app.


    If you can satisfy automatic update only when the app is running, you can archive it by polling server status from the client periodically.

    This is easy to implement because you can use regular HTTP servers for this. Client connect and download recent updates from central server periodically. If there is a new update, just fetch and do what you want. And the app is launched, just check the update at first. Prevent all operation until update applied.

    This is regular way. Most of applications are built with this method. In this case, you have no need to implement server or hard thing.

    However applying speed of update is depend on polling period.


    (Edit)

    I couldn't care about private APIs. Because your app is not for AppStore, so you can use private API's freely. (This is different thing with jail-breaking. There are so many hidden features by excluded from documentation) I don't know about private APIs, but it's possible there is some API which enable the support for keep-alive of the app. However, this reverse engineering work is so painful unless you're born to hack.

    这篇关于如何使用http / ftp上传文件到iphone / ipad? (如ifile,goodreader)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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