0

In my case, all the files have been created via API can be retrieved, however the created file in a specific folder in google drive itself cannot be retrieved.

Example:

I have a folder named "Test". Now the user manually uploads or creates a file called "test.txt" in "Test" folder. The problem is I cannot retrieved the file created because it is created manually not using the API.

I have already use the https://www.googleapis.com/auth/drive which I have read in stackoverflow. But still cannot.

Any help would be appreciated.

Jayjay
  • 103
  • 2
  • 3
  • 10

2 Answers2

0

i have done it in python

khol = DRIVE.files().list(q="'%s' in parents"%<THE FOLDER ID>).execute().get('files', [])

hope it helps

  • In php i've done $parameters = array( 'pageSize' => 100, 'fields' => "nextPageToken, files(id,name)", 'q' => "'".$folderId."' in parents" ); but still cannot retrived the files :( – Jayjay Mar 16 '18 at 02:48
0

Based from this documentation, you can search for files with the files.list method of the Drive API. As referred with this post, you should use Files.list() with parameter q='{{FOLDER_ID}}' in parents and it will list all the files and its details of children of specific folder you want.

abielita
  • 13,147
  • 2
  • 17
  • 59