Google Drive API - Search all files inside a root folder and sub folders in C#

773

I only have objective-C sample code for search all file and folder.

I use recursive way for search all file.

you can use file MIMEType for determine folder or file.

Share:
773

Related videos on Youtube

Gopal Biswas
Author by

Gopal Biswas

Updated on November 30, 2022

Comments

  • Gopal Biswas
    Gopal Biswas over 1 year

    I want to search all files inside a root folder and its sub folders in Google Drive API using C#. Suppose there is a root folder "A" which contains 5 files and a sub folder named "B". The sub folder "B" contains 4 files only. Now I have to populate all the files inside the root folder(5 + 4 = 9 files). Currently I'm populating files like-

    FilesResource.ListRequest list = service.Files.List();
     list.OrderBy = "createdDate";
                    list.MaxResults = 1000;
    if (search != null)
                    {
                        list.Q = search;
                    }
      FileList filesFeed = list.Execute();
    

    If anyone has any idea please share.

    Thanks.

    • comrademike
      comrademike over 10 years
      Are you sure you haven't switched wifi off with a keystroke? laptops have a key set to turn wifi off for when you are on planes. On mine it is f12. worth checking first anyway.
    • Eric Carvalho
      Eric Carvalho over 10 years
      Welcome to Ask Ubuntu! Please use the contact us link at the bottom of this page to ask for your unregistered account and your new registered account to be merged. Thanks.
    • tropikalista
      tropikalista over 10 years
    • BugFinder
      BugFinder almost 8 years
      What problem specifically are you having
    • DaImTo
      DaImTo almost 8 years
      What is search? list will automatically return all the files and folders on drive. Are you trying to say you just want the files and not the directories?
    • Gopal Biswas
      Gopal Biswas almost 8 years
      @ DaImTo... correct. I just need to return all the files not the directories with all file properties.