One month down in 2025: How are your resolutions coming along? Check out how to get back on track 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
- Greg-DB
Dropbox Staff
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 & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 3 hours ago
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 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!