0

I am trying to upload a PDF selected from document picker view(Files App) to an api but I would like to pass parameters with it but I'm not able to.

Code used to upload the file:



 AF.upload(myURL, to: "API Upload Link")
        .authenticate(username: username, password: password)
      .uploadProgress { progress in
          print("Upload Progress: \(progress.fractionCompleted)")
        
      }
  
      .downloadProgress { progress in
          print("Download Progress: \(progress.fractionCompleted)")
      }
        AF.request("API Upload Link").responseJSON { response in
         print("Response: \(response)")
        }

myUrl is the path of the document selected and I am able to upload the document.

But how do I pass parameters with this document while uploading the doc. eg "DocumentType" : "Passport"

The File type is always a PDF.

Thanks in Advance!

emrcftci
  • 3,355
  • 3
  • 21
  • 35

0 Answers0