Upload things to a FTP in Objective-C iOS

淺唱寂寞╮ 提交于 2019-11-29 08:44:05

If you would like an easy library I would recommend using HTTP and the AFNetworking library.

However if you want to do FTP, Apple provides step by step instructions. It is a bit hairy, so I recommend just copy and pasting and tweaking as necessary. You will have to read the docs a tiny bit. Look for the "Uploading a File" section.

http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html

This should help with the initial part that apple does not provide the code for

CFStringRef url = CFSTR("ftp://ftp.somedomain.com/file.txt");
CFURLRef requestURL = CFURLCreateWithString(kCFAllocatorDefault, url, NULL);

CFReadStreamRef readStream = CFReadStreamCreateWithFTPURL(kCFAllocatorDefault, requestURL);

Hope this helps.

Take a look at Apple Simple FTP Sample. All you need is there.

If you are looking for a Framework have a look at the ConnectionKit project.

BlackRaccoon is a good, free, open source library for doing FTP transfers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!