Conflict文件夹移动Dropbox API?

时间:2016-03-23 04:18:27

标签: dropbox-api

我正在尝试将一些文件从一个文件夹移动到另一个文件夹。

这是我的卷曲请求:

curl -X POST https://api.dropboxapi.com/2/files/move \
  --header 'Authorization: Bearer faketokenjskahdLDAKHDALjdj8287ew98ehsahdkkadjhk' \
  --header 'Content-Type: application/json' \
  --data '{"from_path":"/folder1","to_path":"/folder2/folder2.1"}'

每当我打电话给我时,我都会得到这个回应:

{
  "error_summary": "to/conflict/folder/...",
  "error": {
    ".tag": "to",
    "to": {
      ".tag": "conflict",
      "conflict": {
        ".tag": "folder"
      }
    }
  }
}

文档说明了以下关于响应中特定关键词的内容:

conflict :  Couldn't write to the target path because there was something in the way.

folder:  There's a folder in the way. 

怎么会有一个文件夹?这甚至意味着什么?我不知道如何解决这个问题。

可以找到/move端点的文档here

1 个答案:

答案 0 :(得分:3)

通过请求folder1中的文件列表/然后循环遍历每个文件并移动它们来from_path folder1 / filename to_path folder2 / folder2.1 / filename

我需要将文件名放在两个路径的末尾以避免任何冲突!

相关问题