Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
arjung r.
10 years agoNew member | Level 1
how to update the file in the dropbox with a different name but the contents of file are same - using iOS core API
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.
2 Replies
Replies have been turned off for this discussion
- Alexandra F.110 years agoNew member | Level 1
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:FC13SwiftyDropbox11FilesRoutes4moveFS0_FT8fromPathSS6toPathSS_GCS_15BabelRpcRequestCCS_5Files18MetadataSerializerCS2_25RelocationErrorSerializer_
- Greg-DB9 years ago
Dropbox Community Moderator
Also, for reference, if you're using the iOS Core SDK, that corresponds to this method:
- (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!