上传文件从iOS版应用到ftp(Upload files to ftp from iOS appli

2019-06-24 03:05发布

我读了SimpleFTPSample但我需要比这更好的文档的例子。 我Google'd一些其他的例子,但我所发现的网站结束了参照苹果的文档,我还没有发现其他任何没有。

有人能帮我吗? 谢谢。

Answer 1:

写了一个易于使用的FTP上传iOS和它运行在ASIHTTPReq的后台线程礼貌。

https://github.com/soulslicer/QueueFTP



Answer 2:

我相信你可以做到这一点ASIHttpRequest ,这是非常强大的。

从他们的文档 :

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

// Upload a file on disk
[request setFile:@"/Users/ben/Desktop/ben.jpg" withFileName:@"myphoto.jpg" andContentType:@"image/jpeg"
forKey:@"photo"];

// Upload an NSData instance
[request setData:imageData withFileName:@"myphoto.jpg" andContentType:@"image/jpeg" forKey:@"photo"];

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request addPostValue:@"Ben" forKey:@"names"];
[request addPostValue:@"George" forKey:@"names"];
[request addFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photos"];
[request addData:imageData withFileName:@"george.jpg" andContentType:@"image/jpeg" forKey:@"photos"];

你的情况url将是一个FTP网址,例如: ftp://user:password@my.host.com

但是,这不会为你做,或你的要求是做一个FTP客户端,看看这些:

  • https://github.com/valentinradu/WhiteRaccoon
  • https://github.com/jkichline/ACFTP
  • https://github.com/jkichline/ACConnect


Answer 3:

您可能还需要看看黑浣熊是光FTP文件系统,并积极维护。



文章来源: Upload files to ftp from iOS application