I am implementing a function download file on a Google drive. I did this after the guide in quick start .
Now I am loading the function into a specific folder * (Example: loading a file in "My_Folder_name") *. I found a sample in the API Reference . The problem is how can I get parentId (folder id) if I only know the folder name.
I could not find any function to search for a folder by name ...
This is the only way to get the folder by getting all the files, and then check that MimeType is equal to "application / vnd.google-apps.folder" and compare it with the name of the folder.
if("application/vnd.google-apps.folder".equals(body.getMimeType()) && "My_Folder_name".equals(body.getTitle()) ){
....
}
Thanks in advance.
source
share