Forum Discussion

Fenoma's avatar
Fenoma
Helpful | Level 6
4 years ago
Solved

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!!

1 Reply

  • Fenoma's avatar
    Fenoma
    Helpful | Level 6
    4 years ago

    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!!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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!