【问题标题】:Path to find files in Google Drive REST API在 Google Drive REST API 中查找文件的路径
【发布时间】:2016-07-26 08:21:18
【问题描述】:

我想列出一个子文件夹中的所有文件。我不了解 API 参考。 例如路径 我在 Google Drive 中的路径是 CR/CA/UP/files。 我在 Google Drive 中的路径是 CR/NA/UP/files。 我在 Google Drive 中的路径是 CR/DD/UP/files。

对于google文档提供的字符串q list,我应该如何传递呢?

这是我正在使用的 Q。请告知我对 Q 的错误

string Q = "'CR' IN parents and title = 'UP' and trashed = 'false' and mimeType = 'application/vnd.google-apps.folder'";
IList<File> _Files = GoogleDriveHelper.GetFiles(service, Q);

当我使用它时它可以工作,但我不知道是指哪个父文件夹 CA、NA 或 DD

string Q = "title = 'UP' and trashed = 'false' and mimeType = 'application/vnd.google-apps.folder'";

【问题讨论】:

    标签: google-drive-api


    【解决方案1】:

    To list a folders contents 即你需要使用这个 HTTP 请求的孩子

    GET https://www.googleapis.com/drive/v2/files/folderId/children
    

    要列出根文件夹的所有子文件夹,请使用别名 root 作为 folderId 值。

    q 参数,它是一个组合一个或多个搜索词的搜索查询,当您要搜索文件夹内的特定文件时使用。

    【讨论】:

    • string Q = " mimeType = 'application/vnd.google-apps.file' and root='NA' and tramed = false and title ='xxx' ";
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多