title: Swift 3 Alamofire multipart upload
body: <p>Thanks to migration to Swift 3, I find it difficult to compile my project that uses Alamofire.</p>
  
  <p>The problem occurs when uploading multipartFormData:</p>
  
  <pre><code>Alamofire.upload(.POST, URL, headers: headers, multipartFormData: {
          multipartFormData in
  .
  .
  . 
  }) 
  </code></pre>
  
  <blockquote>
    <p>Ambiguous reference to member 'upload(_:to:method:headers:)'</p>
  </blockquote>
  
  <p>Any help much appreciated, thanks in advance!</p>
  
  <p><strong>RESOLVED:</strong></p>
  
  <pre><code> Alamofire.upload(multipartFormData: { (multipartFormData) in
  
          multipartFormData.append(fileData, withName: "file_pack", fileName: "file_pack", mimeType: "text/plain")
  
  
          for (key, value) in self.parameters {
              multipartFormData.append(value.data(using: String.Encoding.utf8)!, withName: key)
          }
          }, with: URL2, encodingCompletion: { (result) in
  
              switch result {
              case .success(let upload, _, _):
  
                  upload.responseJSON { response in
                      self.delegate?.showSuccessAlert()
                      print(response.request)  // original URL request
                      print(response.response) // URL response
                      print(response.data)     // server data
                      print(response.result)   // result of response serialization
                      //                        self.showSuccesAlert()
                      self.removeImage("frame", fileExtension: "txt")
                      if let JSON = response.result.value {
                          print("JSON: \(JSON)")
                      }
                  }
  
              case .failure(let encodingError):
                  self.delegate?.showFailAlert()
                  print(encodingError)
              }
  
      })
  </code></pre>
  
  <p>This is how upload method should be implemented in Swift 3</p>