How can we list all files from a specific folder on Google Drive

前端 未结 4 1261
灰色年华
灰色年华 2021-01-21 01:48

We noticed that Google Drive API Javascript allows you to list all files from an specific folder, however it brings just basic details from the file. If we want

4条回答
  •  既然无缘
    2021-01-21 02:17

    Using googleApis V3 you can do it. This is sample code:

    string FolderId = "1lh-YnjfDFMuPVisoM-5p8rPeKkihtw9";
            // Define parameters of request.
            FilesResource.ListRequest listRequest = DriveService.Files.List();
            listRequest.PageSize = 10;
            listRequest.Q = "'" + FolderId + "' in parents and trashed=false";
            listRequest.Fields = "nextPageToken, files(*)";
    
            // List files.
            IList files = listRequest.Execute()
                .Files;
    

    Hope this help.

提交回复
热议问题