title: How to upload pdf file as multi part form data in alamofire?
body: <p>I have to upload pdf file as multi part form data.<br>
  I read <a href="https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-data-to-a-server" rel="nofollow noreferrer">Alamofire/Usage.md(Uploading Data to a Server)</a></p>
  
  <p>So I write below code.<br></p>
  
  <pre class="lang-swift prettyprint-override"><code>extension ViewController: UIDocumentPickerDelegate {
  
      func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
          guard let url = urls.first else { return }
          print(url) // file:///private/var/mobile/Containers/Data/Application/69C5B45A-AA29-46D2-909C-2A1A5A68C10F/tmp/com.test.test-Inbox/D5100_EN.pdf
          do {
              let data = try Data(contentsOf: url)
              print(data) // 10899227 bytes
              AF.upload(multipartFormData: { multipartFormData in
                  multipartFormData.append(data, withName: "pdf")
              }, to: "https://myurl.com")
                  .responseJSON { response in
                      debugPrint(response) // message = "Required request part 'file' is not present"
              }
          } catch {
              print(error)
          }
      }
  
  }
  </code></pre>
  
  <p>But it was filed.<br>
  How can I upload pdf file as multi part form data in alamofire?</p>