Search code examples
iosswiftsdkthumbnailsdropbox

Dropbox SDK - Swift - (415) Unsupported Media Type


I'm using DropboxSDK in my iOS swift app and when I try to download a thumbnail I receive the (415) Unsupported Media Type error:

2015-10-24 20:10:23.732 PhotondRoll[55084:2520699] [WARNING] DropboxSDK: error making request to /1/thumbnails/dropbox/Pictures/2015/0123. Noche de cine con Pablo/20150123_211742443_iOS.jpg - (415) Unsupported Media Type

This is the line I'm using to download the thumbnail. The rest of the code was created following the Dropbox getting started guide.

if let dirs : [String] = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.AllDomainsMask, true) {
    let dir = dirs[0] //documents directory
    dropboxRestClient.loadThumbnail(metadata.path, ofSize: "s", intoPath: dir)
}

Could you help me?


Solution

  • I was able to solve this issue moving the loadThumbnail call inside a dispatch_async block.