title: How to send array in params using Alamofire multipart from data using swift 4
body: <p>I am using <code>Alamofire</code> for uploading an image and a file to the server. But I am having an issue to send an array in parameters with the image. But when I send an array in params it converts the array in <code>JSON</code> string. But I want to send an array in params, not in <code>JSON</code> string. I have searched a lot but did not get any solution. Here is the code below.</p>
  
  <pre><code>let params = ["id":"101","arrayParam":["1232","12344","14325"]]
  
      let url = www.khxjjhdfsj.com/hsdgs
              let headers: HTTPHeaders = [
                  /* "Authorization": "your_access_token",  in case you need authorization header */
                  "Content-type": "multipart/form-data"
              ]
              Alamofire.upload(multipartFormData: { (multipartFormData) in
                  for (key, value) in params
                  {
                       multipartFormData.append("\(value)".data(using: String.Encoding.utf8)!, withName: key as String)
                  }
                  if let data = imageData
                  {
                      multipartFormData.append(data, withName: "file", fileName: fileName, mimeType: "image/png")
                  }
                  if let data = pdfData
                  {
                      multipartFormData.append(data, withName: "file", fileName: fileName, mimeType:"application/pdf")
                  }
              }, usingThreshold: UInt64.init(), to: url, method: .post, headers: headers) { (result) in
                  switch result{
                  case .success(let upload, _, _):
                      upload.responseJSON { response in
                          print("Succesfully uploaded")
                          if let err = response.error
                          {
                              onError?(err)
  
                              return
                          }
  
  
  
                      }
                  case .failure(let error):
                      print("Error in upload: \(error.localizedDescription)")
                      onError?(error)
                     }
              }
  </code></pre>