Uploaded files are not in Dropbox

111 views Asked by At
@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?

0

There are 0 answers