@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 ")
}
在这里,我试图将文件上传到 Dropbox,但文件没有出现在 Dropbox 中。谁能解释为什么会这样?