Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
rshahec
8 years agoNew member | Level 2
com.dropbox.core.v2.files.RelocationErrorException
Hello Group,
I am trying to do a simple copy/move of one of my files from one folder to another:
SOURCE FOR EXAMPLE:
/my_pictures_and_videos/01 dump yard/aarav (hridansh)/test.jpg
DESTINATION FOR EXAMPLE:
/my_pictures_and_videos/diya/photos/
code that I am writing for the same:
DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
client.files.copyV2("/my_pictures_and_videos/01 dump yard/aarav (hridansh)/test.jpg","/my_pictures_and_videos/diya/photos/");
Please note that I have verified the paths every thing is correct.
Exception I am getting is
Exception in thread "main" com.dropbox.core.v2.files.RelocationErrorException: Exception in 2/files/copy_v2: {".tag":"from_lookup","from_lookup":{".tag":"malformed_path","malformed_path":null}}
at com.dropbox.core.v2.files.DbxUserFilesRequests.copyV2(DbxUserFilesRequests.java:510)
at com.dropbox.core.v2.files.DbxUserFilesRequests.copyV2(DbxUserFilesRequests.java:533)
at org.polymath.dropbox.test.ConnectivityTest.main(ConnectivityTest.java:32)Also the code does work for very simple paths like /getting start.pdf which is root to another file in the same directory
1 Reply
- Greg-DB8 years ago
Dropbox Community Moderator
Is that the exact code you're running? Running that, I get `malformed_path` on your `to_lookup`, not `from_lookup`. (Perhaps you reversed them when simplifying the code for posting here?)
Anyway, your `to_lookup` value is malformed. It ends in a "/". It shouldn't end in "/", and should instead include the full path where you want to copy the file to, include file name. (In your sample, it looks like you're including the path to the desired parent folder.)
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!