Home > database >  Get Google.GoogleApiException 'File not found: [404]' when trying to list files in a non-r
Get Google.GoogleApiException 'File not found: [404]' when trying to list files in a non-r

Time:11-10

I'm trying to access files in Google Drive. I picked up code to create a Google Drive service from enter image description here

Anyone any idea how I can list the contents of other folders? Thanks

CodePudding user response:

fileList.Q = "mimeType != 'application/vnd.google-apps.folder' and 'Admin' in parents";

The issue you are having is that you are using the name of the directory 'Admin' you need to use the file id of the Admin directory.

Do a file.list and search for the admin directory get its file id then pass it to that instead.

fileList.Q = "name ='Admin' and mimeType != 'application/vnd.google-apps.folder'";
  • Related