Download FTP directory contents to ios

2019-01-26 02:01发布

I have a website, let's say it's "http://www.jwilkthings.com/stuff"

I have a bunch of .txt files stored on this website, i.e. "http://www.jwilkthings.com/stuff/text1.txt"

What I'm wanting to do is find a way in iOS to download all of those text files without knowing what the document name is. I can already retrieve them manually as long as I have a file name, but I would rather just get all of them at once and put them in the documents directory if possible. I currently use FileZilla to upload all of the text files, so I can use FTP if needed.

标签: ios xcode ftp
1条回答
三岁会撩人
2楼-- · 2019-01-26 02:30

The correct way to solve this problem is to not use FTP (riddled with performance and security issues), and to configure your web server to expose a table of contents directory listing that your client can parse.

But that's not an answer to your question. If you really want your iOS app to speak FTP, take a look at the SimpleFTP sample project from Apple.

It's old, but I just got it to build on iOS 5. The ListController.m file has the code you're looking for.

enter image description here

查看更多
登录 后发表回答