cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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

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...

Greg-DB
Dropbox Staff

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

- (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
Need more support?
Who's talking

Top contributors to this post

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