简体   繁体   English

适用于iPhone的最佳FTP Objective-C包装器

[英]Best FTP Objective-C wrapper for iPhone

I know you use the C based networking API to do FTP communication but I'd prefer to use something a little higher level. 我知道您使用基于C的网络API进行FTP通信,但我更喜欢使用更高级别的工具。 I've seen a few Objective-C based wrappers but I'm not sure what to use. 我看过一些基于Objective-C的包装器,但不确定使用什么。 I don't need that complex of FTP interaction. 我不需要复杂的FTP交互。 Its just the typical create/delete dirs, upload/download files... What do you recommend? 它只是典型的创建/删除目录,上传/下载文件...您建议什么?

Edit: Here is one that looks promising but I can't get it to compile for the iPhone SDK The ConnectionKit 编辑:这是一个看起来很有前途的应用程序,但我无法为iPhone SDK The ConnectionKit进行编译

This may help, but you may reconsider design for reasons stated by bbum: 这可能会有所帮助,但出于bbum所述的原因,您可能会重新考虑设计:

http://code.google.com/p/s7ftprequest/ http://code.google.com/p/s7ftprequest/

The reason why you can't find much in the way of useful FTP client software is because FTP isn't used much any more and is generally actively discouraged from use. 之所以无法在有用的FTP客户端软件中找到太多的原因,是因为不再使用FTP,并且通常不鼓励使用FTP。

Without great care, it is quite easy to create big old security holes when using FTP (when I ran a consulting company, the 3 times we had infected machines were all because of FTP server security holes or exploits -- one time, the damned HP copier's FTP server was the attack vector!). 如果不加小心,使用FTP时就很容易造成较大的旧安全漏洞(当我经营一家咨询公司时,我们感染计算机的3倍都是由于FTP服务器的安全漏洞或漏洞利用-一次,该死的惠普复印机的FTP服务器就是攻击媒介!)。

FTP is also inefficient unless carefully configured. 除非仔细配置,否则FTP的效率也很低。

I would encourage you to use an HTTP based protocol. 我鼓励您使用基于HTTP的协议。 WebDAV allows you to do basically anything FTP can do, but does so over an HTTP channel. WebDAV基本上允许您执行FTP可以执行的任何操作,但是可以通过HTTP通道执行。 Thus, it'll work through proxies and the like. 因此,它将通过代理等工作。 Heck -- HTTP has become so ubiquitous that pretty much everything works with HTTP. 哎呀-HTTP变得无处不在,以至于几乎所有东西都可以使用HTTP。

And, of course, there are plenty of good HTTP client APIs built for Objective-C. 而且,当然,有很多针对Objective-C构建的良好的HTTP客户端API。

Obviously, if FTP is a requirement for your project, this answer won't help you much.... 显然,如果您的项目需要FTP,那么这个答案对您没有太大帮助。

After not finding anything that works well I decided I'd go ahead and follow Apple's tutorial on how to do FTP. 在找不到任何有效的方法后,我决定继续并遵循Apple的FTP教程。 It sure is a PITA but at least it does work. 当然是PITA,但至少它确实有效。 I'm defiantly going to support WebDAV in the first revision my app, and eventually perhaps some other transfer methods later on. 我将在我的应用程序的第一个修订版中竭力支持WebDAV,稍后可能还会支持其他一些传输方法。 I think I'm going to consider releasing this open source after I get FTP & WebDAV working good, since there is no reason why you should have to do this much low level work to do such a basic and ambiguous task as FTP these days. 我认为在FTP和WebDAV正常运行之后,我将考虑发布此开放源代码,因为如今没有理由要做如此低端的工作来完成诸如FTP这样的基本任务。

I've implemented FTP file download and upload, directory create and directory list download through the regular FTP possibilities in the iPhone SDK. 我已经通过iPhone SDK中的常规FTP功能实现了FTP文件下载和上传,目录创建和目录列表下载。 Note: you'd be passing the login name and password as part of every FTP request unsecured. 注意:您将在每个不安全的FTP请求中传递登录名和密码。 Apparently no apparent connection to the FTP server is maintained at the app level, like with a real FTP client app, that I haven't been able to find for iPhone yet. 显然,在应用程序级别上并没有维护与FTP服务器的明显连接,就像真正的FTP客户端应用程序一样,我还无法为iPhone找到该连接。 If you're interested in the source code please let me know through e-mail. 如果您对源代码感兴趣,请通过电子邮件告知我。

GoldRaccoon isn't mentioned and can be found on GitHub. 没有提到GoldRaccoon,可以在GitHub上找到它。 I use that library and it works very well (besides it didn't support FTP rename) 我使用该库,并且运行良好(但不支持FTP重命名)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM