Google Drive API - List files from a folder

Asked

Viewed 1,139 times

0

With the following code, I am able to list all folders present in my Drive.

function listFiles() {
  gapi.client.drive.files.list({
      'maxResults': 1000,
      'q': "mimeType contains 'application/vnd.google-apps.folder'"
    }).then(function(response) {
        appendPre('Arquivos:\n');
        var files = response.result.items;
        if (files && files.length > 0) {
          for (var i = 0; i < files.length; i++) {
            var file = files[i];

            appendPre(file.title + ' - ' + file.embedLink);
            console.log(file);

However, now that I can list the folders, I would like to be able to list the files that are inside them. I am grateful to those who can help.

  • Could you tell which language you are using?

  • I am using javascript

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.