0
我想要讀取文件內容,但webContentLink正在變成undefined.But其他值實現。我不明白。這是我的代碼部分:Google App Engine Drive API閱讀文件內容(返回undefined)
function handleAuthClick(event) {
var options = {
client_id: CLIENT_ID,
scope: SCOPES,
immediate: false
};
gapi.auth.authorize(options, handleAuthResult);
return false;
}
function makeApiCall() {
gapi.client.load('drive', 'v2', makeRequest);
}
function makeRequest() {
var request = gapi.client.drive.files.list({'q': "title contains '--'"});
request.execute(function(resp) {
for (i=0; i<resp.items.length; i++) {
alert(resp.items[i].webContentLink);//problem is here turning undefined
var titulo = resp.items[i].title;
var fechaUpd = resp.items[i].modifiedDate;
var userUpd = resp.items[i].lastModifyingUserName;
var userEmbed = resp.items[i].embedLink;
var userAltLink = resp.items[i].alternateLink;
var fileInfo = document.createElement('li');
fileInfo.appendChild(document.createTextNode('TITLE: ' + titulo + ' - LAST MODIF: ' + fechaUpd + ' - BY: ' + userUpd));
document.getElementById('content').appendChild(fileInfo);
}
});
}