-
Notifications
You must be signed in to change notification settings - Fork 273
How can I upload a file to team drives folder? #149
Comments
Just make sure your credentials have access to that Team Drive, and then add a few more parameters like so:
Once you get the ID, the process for uploading is as usual |
I still can't upload files to team drives folder, but i can list them. This is my code to upload files: f = drive.CreateFile({
'supportsTeamDrives': 'true',
'teamDriveId': 'XXXXXXXXXXXXX',
'corpora': 'teamDrive',
'name' : 'test',
'includeTeamDriveItems': 'true',
'mimeType' : 'application/vnd.google-apps.folder',
'parents': [{
'kind': 'drive#fileLink',
'id': 'XXXXXXXXXXXXX',
'teamDriveId': 'XXXXXXXXXXXXX'
}]
})
f.Upload() I don't know if this is because of permissions or else, and i don't know how to check it either. Can anyone help me on this ? |
@spartako How do you find the team drive id? |
@bendavis78 |
Credits to this StackOverflow Answer
Here is my code which worked
|
This seems the right place to ask: How can I download a file? Unfortunately, just adding the
|
I am having the same problem. I have searched everywhere but no luck so far. The
This is the Get request captured in my logger: I tried setting up as suggested with the nested params to no avail too:
Like the above commenter said the
works fine. Any help in getting it to send the correct Get request would be much appreciated. Thanks! |
@rarup1 you need to add query parameters to the ListFile() call ie
Without the query params you're not actually looking for anything! |
I have the exact same question as @rarup1. I know @fergusleahytab has brought modifications to PyDrive, but I am still not sure how to modify @rarup1's code to download files from a shared folder (where to put 'supportsTeamDrives': True if there any need for it). Any help would be deeply appreciated. Kind regards, |
@cccat6 you could also check the maintained PyDrive2 fork. It has that (and many other fixes) in it. |
Ops... I didn't notice there is a PyDrive2. Spends me an hour on positioning the point :( |
I already made a python script to upload file to specified folder,
but I can't find the team drive folder by id.
Can anyone give me a hint? Thanks.
The text was updated successfully, but these errors were encountered: