8
votes

How to edit file or folder name using dropbox api?

I was using this reference: https://www.dropbox.com/developers/core/docs

Is there anything else?
Is it even possible?

2

2 Answers

9
votes

Your question title and body seem to ask slightly different questions, so I'll answer both:

You can edit a file (i.e., its contents) by uploading a new version of it, e.g., using the /files_put call:

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

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

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

0
votes

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

  1. Get Name of File and Change it and store the change name in string variable.
  2. Keep Parent Path of the original File.
  3. Move File to other place with the change Name get from String variable.
  4. Now move the File back from new place to old place,
                 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