Closed coloradotechie closed 4 years ago
Uploaded files should not be any different from documents in the API. Indeed, most of the files I changed ownership for with this script were files, not native Google Docs.
Do you have more details on the error?
I simply can't transfer ownership of a JPEG or PDF, not even through the web interface. I have a standard ("consumer") Google account. What kind of account do you have?
Google Apps Customers: Only Google Apps customers in Government and Education domains can transfer ownership of a synced or uploaded file (like a PDF or image file). Consumer Drive users: You can't transfer ownership of a synced or uploaded file (like a PDF or an image file).
This is the reason: "You can only transfer ownership of Google Docs, Sheets, Slides, or Forms"
@mightyiam is correct for general Gmail use. However, G Suite users can use this to transfer ownership of any file type located in Google Drive. This is not a bug, but rather the way Google handles permissions across gmail domains.
This is a limitation of the Google Drive product. Several folks here are correct that it's useful to transfer ownership among accounts on a G Suite Google Drive, which is what I originally wrote this for.
Thank you for following up, @davidstrauss.
Hi,
On this line in the python code return service.permissions().update(fileId=drive_item['id'], permissionId=permission_id, body=permission, transferOwnership=True).execute()
I'm getting this error: An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/randomcharacters/permissions/some_numbers?transferOwnership=true&alt=json returned "Insufficient permissions for this file">
Does the code need to be updated to allow for ownership changes to files that have been uploaded to google drive?