【发布时间】:2015-11-09 19:14:18
【问题描述】:
我想获取在视图上显示的 Dropbox 文件的缩略图。我知道我必须使用 loadThumbnail 方法,但我不知道该怎么做。
我写了这个:
for file in dropboxMetadata.contents {
dbRestClient.loadThumbnail(file.path, ofSize: "s", intoPath: "https://api-content.dropbox.com/1/thumbnails/auto/")
}
但我得到一些这样的错误:
error making request to /1/thumbnails/dropbox/star.jpg - (4) Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed.
感谢您的帮助!
【问题讨论】:
-
展示你的“
- (void)restClient:(DBRestClient *)client loadedThumbnail:(NSString *)destPath metadata:(DBMetadata *)metadata”实现 -
intoPath必须是您可以在本地写入的位置。 -
如果我是对的,我必须把缩略图放在我自己的网址上吗? @MichaelDautermann 我还没有看到这个方法,所以当缩略图准备好时,我可以在我的视图中放置图像?
-
所以我用这个替换了方法:
client.loadThumbnail("https://api-content.dropbox.com/1/thumbnails/auto/", ofSize: "s", intoPath: "http://myUrl"),我得到了这个错误:error making request to /1/thumbnails/dropboxhttps://api-content.dropbox.com/1/thumbnails/auto - (400) Expected 'root' to be 'dropbox', 'sandbox', or 'auto', got u'dropboxhttps:' -
path 是文件系统路径,而不是 URL。
标签: ios swift thumbnails dropbox