![](/img/trans.png)
[英]How to List all the files from google team drive using google drive api with node js
[英]Node: Google Drive API for listing all files using query
我可以知道如何使用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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.