cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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 update the file in the dropbox with a different name but the contents of file are same - using iOS core API

how to update the file in the dropbox with a different name but the contents of file are same - using iOS core API

arjung r.
New member | Level 1

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 2

Re: how to update the file in the dropbox with a different name but the contents of file are same - using iOS core API

Alexandra F.1
New 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:FC13SwiftyDropbox...

Re: how to update the file in the dropbox with a different name but the contents of file are same - using iOS core API

Greg-DB
Dropboxer

Also, for reference, if you're using the iOS Core SDK, that corresponds to this method:

- (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Alexandra F.1 New member | Level 1
What do Dropbox user levels mean?
Need more support?