Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have used the below method to update a file,
- (void)uploadFile:(NSString *)filename toPath:(NSString *)path withParentRev:(NSString *)parentRev
fromPath:(NSString *)sourcePath;
I want to update a file say abc.txt in the dropbox, with the same content but with different filename say def.txt. For this, I have get the parentRev of abc.txt and i have changed the filename to def.txt and uploaded the def.txt with the same parentRevision. But, the def.txt was uploaded as a separate file instead of replacing/updating the abc.txt. Now, the dropbox contains two files abc.txt and def.txt. Please tell me is there any way to replace the file abc.txt with def.txt. Thank you.
Yes, you can use the /move endpoint to move the contents from one path in Dropbox to another. In your example, you would set 'abc.txt' as the fromPath value, and 'def.txt' as the toPath. Here's the link to the Swift SDK documentation: http://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:FC13SwiftyDropbox...
Also, for reference, if you're using the iOS Core SDK, that corresponds to this method:
- (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!