0
@IBAction func saveFile(_ sender: Any) {

let client = DropboxClientsManager.authorizedClient

let fileData = "testing data example".data(using: String.Encoding.utf8, allowLossyConversion: false)!

    let request = client?.files.upload(path: "/test/path/in/Dropbox/account", input: fileData).response { response, error in
            if let response = response {
                print("The upload response is \(response)")
            } else if let error = error {
                print("The upload error is \(error)")
            }
        }
        .progress { progressData in
            print(progressData)
    }

  // in case you want to cancel the request
  //        if someConditionIsSatisfied {
  //            request.cancel()

        print(" View Loaded ")
    }

Here I am trying to upload the file to the Dropbox but the file is not appearing in the Dropbox. Can anyone explain why this happens?

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.