How to check if a file exists in a Dropbox account of a specific user using the Dropbox iOS SDK 1.1?

I am currently developing an application using the Dropbox iOS SDK version 1.1. I am developing an application for iOS version 5.0 and higher. I looked at all the methods in the DBRestClient.h file, which is included in the SDK. I could not find a method that allowed me to check whether a given file exists in a given location in the directory. I was thinking if I can use the following method in the DBRestClient.h file to do the same

- (void)loadMetadata:(NSString*)path;

Here, I thought about using the Location / FileName parameter in the Path parameter to find out if this file exists or not.

I am not entirely sure of the right approach to doing the same. Please suggest some best methods if this is not the case.

+3
source share
1 answer

The Dropbox SDK does not support search (it only supports a subset of the Dropbox API). To do what you need, you can directly call the REST API lookup method

https://www.dropbox.com/developers/reference/api#search

If you want to stick with the SDK, you can call loadMetadata recursively for each folder level until you find the file you want. But I do not recommend this (imagine if your user is on a cellular network when you make dozens or hundreds of calls).

0
source

All Articles