We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
sajadjaward1
5 years agoExplorer | Level 4
Batch copy within Dropbox gives an error
Hello All! I am using Dropbox Javascript SDK to manage my files within Dropbox. I have come across a scenario where I need to copy 1 or many files (depends) into a single folder. For this, I ...
- 5 years ago
Yes, you can use this filesCopyBatchV2 method to copy files from multiple different locations into one folder. When doing so though, each 'to_path' shouldn't all be exactly the same. The 'to_path's can all be inside the same folder, but they should include the different file names so they don't conflict with each other.
Greg-DB
5 years agoDropbox Staff
This 'failure/relocation_error/to/conflict/folder' error indicates that the operation failed because there is already a folder at the destination path you specified.
Note that when specifying a destination path like this, you should specify the full path where you want to put the item, including both the path of the parent folder, as well as the desired name of the file/folder itself.
In your code, you're setting the destination as `'/Destination/' + randomNum ` for each `file`, and you mentioned "the destination would be the same", so it sounds like this error is to be expected. You will need to set a distinct `to_path` for each item. For example, perhaps you want to do something like:
to_path: '/Destination/' + randomNum + '/' + file
- sajadjaward15 years agoExplorer | Level 4
Thank you for replying.
Is there any way that I can copy all the files from different paths into a same destination folder? I do not want to end up having so many folders created at the destination for each file that I am copying.
Does Dropbox have an API which supports this method?
Thank you again
- Greg-DB5 years agoDropbox Staff
Yes, you can use this filesCopyBatchV2 method to copy files from multiple different locations into one folder. When doing so though, each 'to_path' shouldn't all be exactly the same. The 'to_path's can all be inside the same folder, but they should include the different file names so they don't conflict with each other.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 5 hours agoIf 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 or Facebook.
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!