3
votes

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.

1

1 Answers

1
votes

From the NSURLSession Class Reference

The NSURLSession class and related classes provide an API for downloading content via HTTP.

You can use other library with CFNetwork Framework like WhiteRaccon to upload file to FTP server.