3

I want to upload files to an FTP. I would like to use NSURLSession for its backgrounding support. Apple documentation says it is supported but so far I have been unable to find it. The POC I have done is as follows:

The sample code from apple here uses NSStreams which I would like to avoid. On the other hand Apple's URL programming guide here says:

The URL loading system provides support for accessing resources using the following protocols:

  • File Transfer Protocol (ftp://)
  • Hypertext Transfer Protocol (http://)
  • Hypertext Transfer Protocol with encryption (https://)
  • Local file URLs (file:///)
  • Data URLs (data://)

So far I have searched through NSURLSessionUploadTask and NSURLSessionDataTask but I have only been able to find HTTP protocols, which will not work for FTP.

Much appreciate any help and thanks in advance.

4

1 回答 1

1

来自NSURLSession 类参考

NSURLSession 类和相关类提供了通过 HTTP 下载内容的 API。

您可以使用带有CFNetwork框架的其他库,如WhiteRaccon将文件上传到 FTP 服务器。

于 2014-04-28T06:39:21.300 回答