You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Fenoma's avatar
Fenoma
Helpful | Level 6
3 years ago

API Copy Folder Error

Hi, i succesfuly copy files from one folder to another with the copy_v2, but when I try to copy a whole folder, it throws me an error: 

 

{"error_summary": "from_lookup/malformed_path/.", "error": {".tag": "from_lookup", "from_lookup": {".tag": "malformed_path"}}}

 

Let's say that I want to copy the folder "content" from "folderA" to "folderB", and folderB doesn't have a "content" folder. The paths i'm using are like this:

$from = "/root/folderA/content/";

$to = "/root/folderB/";

 

I don't understand what Am I doing wrong. I also try with:

 

$from = "root/folderA/content/";

$to = "/root/folderB/content/";

 

but it didn't work neither.

  • I found the solution. Just need to remove the last  "/" from both paths.

     

    Bottom line, It should be this way to copy folders:

     

    $from = "root/folderA/content";

    $to = "/root/folderB/content";

     

    Thanks!!

  • Fenoma's avatar
    Fenoma
    Helpful | Level 6

    I found the solution. Just need to remove the last  "/" from both paths.

     

    Bottom line, It should be this way to copy folders:

     

    $from = "root/folderA/content";

    $to = "/root/folderB/content";

     

    Thanks!!