我想知道如何使用 GoogleAPIS 库查询 Google 云端硬盘中的所有文件
https://github.com/google/google-api-nodejs-client/
我不知道如何使用这个库!
我不知道应该在哪里放置查询,我已经尝试了下面的代码,但没有得到任何响应..
测试1:
drive.files.list("mimeType='image/jpg'", function(data){
//I am getting all the data, the query is not working..
));
测试2:
drive.files.list({
media: {
mimeType: 'application/vnd.google-apps.folder'
}
}, function(err, data){
//I am getting all the data, the query is not working..
});
测试3:
drive.files.list({
resource: {
mimeType: 'application/vnd.google-apps.folder'
}
}, function(err, data){
//This returns error not working at all!
});
最佳答案
您可以检查此处给出的drive.files.list函数https://github.com/google/google-api-nodejs-client/blob/master/apis/drive/v2.js#L733并使用类似以下内容的内容。
var drive = google.drive({ version: 'v2', auth: oauth2Client });
drive.files.list({
q='mimeType='image/jpg''
}, callback);
有关列表函数的输入参数的更多详细信息,请参见 https://developers.google.com/drive/v2/reference/files/list
关于node.js - Node : Google Drive API for listing all files using query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26781324/