null0pointer
null0pointer

Reputation: 1543

Dropbox API uploading files

I'm trying to upload an edited version of a .txt file to Dropbox using the API for iOS but I can't seem to figure out how to use the ParentRev part of the API call. The call I am using is

[[self restClient] uploadFile:dropboxFilename toPath:dropboxDirectory withParentRev:[dropboxDirectory stringByAppendingString:dropboxFilename] fromPath:localDirectory];

dropboxFilename is the title of the file in dropbox. dropboxDirectory is the location of the file in dropbox. localDirectory is the path for the file on the device.

If I use 'nil' the upload works fine but it creates a new file called "example (1).txt" (of course). But if I try to set the previous version of the file it returns a 500 error.

I haven't been able to find any documentation online on how to use ParentRev properly.

Upvotes: 1

Views: 1230

Answers (1)

null0pointer
null0pointer

Reputation: 1543

Turns out ParentRev is not the previous file name like I thought. It's just a value you retrieve from the meta-data you can download for the file.

Upvotes: 2

Related Questions