Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive API: I have to fetch only files in that folder without trashed files

I am trying to get a list of files in a folder on Google drive using the Google drive API. When I make my request I am getting a list of child elements in that folder including previous deleted files.

How do I get only the files that are in the folder without the ones that have been deleted or trashed?

like image 961
Vinay Dev Avatar asked Dec 05 '25 21:12

Vinay Dev


1 Answers

I don't think you are seeing deleted files. Deleted files are permanently deleted. I think you are seeing trashed files which are like putting files in the trash can on windows, they are removed but not really gone.

You want to add a search parameter to your files.list request. you want to tell it to not include trashed.

trashed = false

like image 147
DaImTo Avatar answered Dec 08 '25 11:12

DaImTo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!