1

在此处输入图像描述

这是我到目前为止尝试过的代码:

client?.files.download(path: "/AlloyTest/\(imageName)").response { response, error in
    if let response = response {
      let responseMetadata = response.0
      print(responseMetadata)
      let fileContents = response.1
      print(fileContents)
    } else if let error = error {
      print(error)
    }
  }
  .progress { progressData in
    print(progressData)
  }

这是我在尝试以下功能时遇到的错误:

API route error - {
  ".tag" = path;
  path =   {
    ".tag" = "not_found";
  };
} 

新代码

func getImage(imageName: String, completion: @escaping (UIImage, NetworkingError) -> ()) {
    // Get Image from dropbox
    // Download to Data
    client?.files.listFolder(path: "/AlloyTest").response { response, error in
      if let response = response {
        let entries = response.entries
        print("ENTRIES:", entries)
      } else if let error = error {
        print(error)
      }
    }
  }
4

1 回答 1

1

path/not_found错误表示指定路径(在本例"/AlloyTest/\(imageName)"中为连接的 Dropbox 帐户)中没有任何内容。确保提供正确的路径。

例如,您可以使用listFolder/列出任何特定文件夹的内容以获取其内容的正确路径值listFolderContinue。任何特定返回项目的路径是Metadata.pathLower

于 2020-05-26T18:09:53.903 回答