Delete file by name #357
-
How do I delete a file on google drive, knowing only its name but not the file id? |
Beta Was this translation helpful? Give feedback.
Answered by
shcheklein
Aug 22, 2024
Replies: 1 comment 2 replies
-
Hi @VC-dell ! It's possible to do the listing first to get IDs (e.g. here https://docs.iterative.ai/PyDrive2/filemanagement/#get-files-by-complex-queries ). And then use that ID to delete the file. Also, keep in mind - Google allows duplicate names - so you might receive multiple IDs back for a single query. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
VC-dell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @VC-dell ! It's possible to do the listing first to get IDs (e.g. here https://docs.iterative.ai/PyDrive2/filemanagement/#get-files-by-complex-queries ). And then use that ID to delete the file. Also, keep in mind - Google allows duplicate names - so you might receive multiple IDs back for a single query.