I am trying to upload thumbnail images of my Dropbox account, but I have an error. I create a local directory in the first method to host the thumbnails, and I request to download them, but it does not work.
Here is my code:
// Create directory method func createTempDirectory() -> String? { let tempDirectoryTemplate = NSTemporaryDirectory() tempDirectoryTemplate.stringByAppendingPathComponent("XXXXX") let fileManager = NSFileManager.defaultManager() var err: NSErrorPointer = nil if fileManager.createDirectoryAtPath(tempDirectoryTemplate, withIntermediateDirectories: true, attributes: nil, error: err) { return tempDirectoryTemplate } else { return nil } } // Get thumbnails images func restClient(client: DBRestClient!, loadedMetadata metadata: DBMetadata!) { temporaryDirectory = createTempDirectory()! for file in metadata.contents { if (file.thumbnailExists == true) { client.loadThumbnail(file.path, ofSize: "s", intoPath: temporaryDirectory) } } self.collectionView?.reloadData() }
And this is a mistake:
[WARNING] DropboxSDK: error making request to /1/thumbnails/dropbox/star.jpg - (4) Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn't be completed. (Cocoa error 4.)
Thanks for your help!
source share