title: Upload files with parameters from multipartformdata using alamofire 5 in ios swift
body: <p>I am trying upload files with parameters (multipartformdata) but i can't do it with new version Alamofire 5, if you have some experience with Alamofire 5 please share it with me.</p>
  <pre><code> func uploadPluckImage(imgData : Data, imageColumnName : String,  url:String,httpmethod:HTTPMethod,completionHandler: @escaping (NSDictionary?, String?) -&gt; ()){
      let token = UserDefaults.standard.string(forKey: PrefKeys.loginToken) ?? &quot;&quot;
      let authorization = [&quot;Authorization&quot; : &quot;Bearer \(token)&quot;]
      let parameters: Parameters?
      parameters = [
          &quot;garbageCollector&quot;: 0,
          &quot;stuff_uuid&quot;: &quot;2b4b750a-f4a6-4d61-84ce-7c42b5c030ee&quot;,
          &quot;delete_file&quot; : &quot;&quot;
      ]
      let headers : HTTPHeader?
      headers = [&quot;Authorization&quot; : &quot;Bearer \(token)&quot;]
      let imageURl = &quot;http://68.183.152.132/api/v1/stuff/uploader&quot;
      
   
      AF.upload(multipartFormData: { (multipart: MultipartFormData) in
          let imageData = self.firstImage.image?.jpegData(compressionQuality: 0.7)
              multipart.append(imageData, withName: &quot;file&quot;, fileName: &quot;file.png&quot;, mimeType: &quot;image/png&quot;)
          
          for (key, value) in parameters!{
              multipart.append(value as! String).data(using: .utf8)!, withName: key)
          }
      },usingThreshold: UInt64.init(),
         to: imageURl,
         method: .post,
         headers: headers,
         encodingCompletion: { (result) in
          switch result {
          case .success(let upload, _, _):
              upload.uploadProgress(closure: { (progress) in
                print(&quot;Uploading&quot;)
              })
              break
          case .failure(let encodingError):
              print(&quot;err is \(encodingError)&quot;)
                  break
              }
          })
  }
  </code></pre>