I am developing an iOS application using Dropbox API. While uploading a file using the dropbox API, I just want to overwrite the existing file with the same name. How can I set the parent rev and what value? Thanks!
Get all the files in the directory with [[self restclient] loadMetadata:@"/"]
in the delegate - (void)restClient:(DBRestClient *)client loadedMetadata:(DBMetadata *)metadata
you get all the details of each file.
Scan through all the files with file name of your interest and get the rev details with file.rev and store it.
When you want to replace the file, for parentrev
argument, give the nsstring
as what you stored with file.rev
https://www.dropbox.com/developers/reference/api#files_put
Refering to the Dropbox API you just have to specify the parent_rev parameter. If you don't know the parent_rev, just call the https://www.dropbox.com/developers/reference/api#metadata for the file. In the response of that call, you will find the parent_rev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With