{ ".tag" = "not_file"; };
I am trying to download a file using SwiftyDropbox. I can connect to Dropbox ok and I can access my Dropbox files, but I cannot download files. My code:
let client = Dropbox.authorizedClient
let destination : (NSURL, NSHTTPURLResponse) -> NSURL = { temporaryURL, response in
let fileManager = NSFileManager.defaultManager()
let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
let UUID = NSUUID().UUIDString
let pathComponent = "\(UUID)-\(response.suggestedFilename!)"
return directoryURL.URLByAppendingPathComponent(pathComponent)
}
let fromPath = "/Panther4/\(filenameX)"
let toPath = destination
client!.files.download(path: fromPath, destination: toPath).response { response, error in
if let (metadata, data) = response {
print("Dowloaded file name: \(metadata.name)")
print("Downloaded file data: \(data)")
} else {
print(error!)
}
}
and the error I get is:
[request-id 953b09474eb624414a4a43c7eeabc88c] API route error - {
".tag" = path;
path = {
".tag" = "not_file";
};
}
Any help would be appreciated.