cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check if a file or folder exists on Dropbox in the new Dropbox iOS SDK which is now available ?

How to check if a file or folder exists on Dropbox in the new Dropbox iOS SDK which is now available ?

Rahul M.1
New member | Level 1

I see some responses of checking if the file exists via DBFileSystem over internet, but this was in Sync API which is not available now. There is nothing I am able to find the new DropboxSDK.framework for checking if a file or folder exists before creating a new one. I can use tricks to do this, but is there any official method to do this ? Further, I've tried to use a trick of loading metadata for a non-existent path to see if an error comes in response which can be used to determine the specific file or folder does not exist. But, the Dropbox SDK fails saying that it is not able to create the path for query as it is not existing. However, this message is only seen as a warning and not in any callback to act upon. Can anyone help on this ?

2 Replies 2

Steve M.
Dropbox Staff

I think you're on the right track. You should call loadMetadata on the path you're interested in, and then the loadMetadataFailedWithError method on your delegate should be invoked with the error that the path doesn't exist. See https://www.dropbox.com/developers/core/start/ios#listing.

Rahul M.1
New member | Level 1

Steve,
I've tried loadMetaData method, it is calling the delegate and showing proper error. Yesterday, it wasn't getting called and SDK was only throwing warning and silently failing. Could be my mistake somewhere. Thanks and sorry for bothering on such small stuff.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Rahul M.1 New member | Level 1
  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?