Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Hippo M.
9 years agoNew member | Level 1
folder in the way conflict/error when using /move API endpoint
Getting a not very intuitive error whenever I try to move files from one folder to another using the API. Please check out my full question in stackoverflow here: http://stackoverflow.com/questions/36169788/conflict-folder-move-dropbox-api
2 Replies
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
It looks like you already got this working.
For reference, the /move endpoint lets you move items, be it files or folders. Both the to_path and from_path must specify the full, exact path of the existing item and the new desired path, respectively. If you wanted to move an entire folder, which is currently at /folder1, to be a folder at named folder2.1, inside a folder at /folder2, you need to make sure there isn't already a folder at /folder2/folder2.1 (even if the existing folder2.1 is empty).
Alternatively, to move all of the contents of a folder from one folder to another, you have to loop through to move each item as desired, like you described in your answer.
- Hippo M.9 years agoNew member | Level 1
yes! I ended up doing exactly that - looping through each file. I was under the impression that by not specifying the full path, it would move all the contents of the folder, and that is (at least in my eyes) what the description of the endpoint says in the docs!
"Move a file or folder to a different location in the user's Dropbox.
If the source path is a folder all its contents will be moved."Instead, when I wasn't specifying the file in the path, it would attempt to move the folder itself, not just the contents!
In addition the definition of to_path is the following: "
to_pathString Path in the user's Dropbox that is the destination."It doesn't say anything about having to specify how you'll be calling the file/folder that you are trying to move. So I thought that the path specified was just my destination and the name of my file would be inherited from the source. Hence there would be a conflict. It might be because English isn't my native language that I am getting confused by these definitions, but I think it would help making them clearer in the docs regardless.
For instance, the definition of the error didn't help much either. Instead of "conflict" meaning "there is something in the way" it might be better to say "there is a folder or file in the destination that is named like your to_path destination" or something along those lines...
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!