Change file name in Dropbox API

How to edit file or folder name using dropbox api?

I used this link: https://www.dropbox.com/developers/core/docs

Is there anything else?
Is it possible?

+7
dropbox edit dropbox-api
source share
2 answers

The title of the question and your body ask a few different questions, so I will answer both:

You can edit the file (i.e. its contents) by downloading its new version, for example, using the / files _put call:

https://www.dropbox.com/developers/core/docs#files_put

You can rename a file or folder using the endpoint / filesops / move:

https://www.dropbox.com/developers/core/docs#fileops-move

+9
source share

Don't worry about it if you have a file and you want to rename it, just follow this logic to solve your problem.

  • Get the file name and change it and save the change name in a string variable.
  • Save the parent path of the source file.
  • Move the file to another location with the change. Name get from String variable.
  • Now move the file from a new location to its original location,
How to do it Programatically, 
  Entry global_file;//assign any file to it String FilePath=global_file.path; String parent_path=global_file.parentPath();//Keep parent path String ChanageName= "Your changed Name"; parent_path=parent_path+""+ChanageName; //setting path for renamed file to move to its original place. Entry RenamedFile = mApi.move(FilePath, "/"+ChanageName); //move to new place "/" Entry MoveRenameFile = mApi.move(RenamedFile.path,parent_path); //move to previous location 
0
source share

All Articles