title: The operation couldn’t be completed. (NSURLErrorDomain error -1011.)
body: <p>I'm trying to upload an image to a <strong>FTP</strong> server using <code>swift 4</code> </p>
  
  <p>I used <a href="https://github.com/amosavian/FileProvider" rel="nofollow noreferrer">FileProvider</a> which is a library for Ftp connection iOS</p>
  
  <p>anyway I'm checking the provider is reachable. and Im getting this error </p>
  
  <blockquote>
    <p>The operation couldn’t be completed. (NSURLErrorDomain error -1011.)</p>
  </blockquote>
  
  <p>this is the full error object:</p>
  
  <blockquote>
    <p>Error Domain=NSURLErrorDomain Code=-1011 "(null)" UserInfo={NSErrorFailingURLKey=<a href="ftp://xxxx.xxxx.xxxx.xxxx:21/" rel="nofollow noreferrer">ftp://xxxx.xxxx.xxxx.xxxx:21/</a>, NSErrorFailingURLStringKey=<a href="ftp://xxxx.xxxx.xxxx.xxxx:21/" rel="nofollow noreferrer">ftp://xxxx.xxxx.xxxx.xxxx:21/</a>, NSURL=<a href="ftp://xxxx.xxxx.xxxx.xxxx:21/" rel="nofollow noreferrer">ftp://xxxx.xxxx.xxxx.xxxx:21/</a>}</p>
  </blockquote>
  
  <p>this is my code:</p>
  
  <pre><code> self.ftpProvider!.isReachable { (flag, error) in
          if flag {
              print("RIZK:--- provider is reachable ")
  
              let progress = self.ftpProvider!.copyItem(localFile: localURL, to: "/files/\(imageName)", overwrite: true, completionHandler: { (error) in
                  if error == nil {
                      print("RIZK:-- Ready to upload")
                  }else{
                      print("RIZK:--\(error?.localizedDescription ?? "")")
                  }
              })
  
              print(progress?.fractionCompleted ?? 0)
  
          }else{
              print("RIZK:--- provider not reachable, with error \(error?.localizedDescription ?? "") ")
          }
      }
  </code></pre>