Ownership of Google Drive API files downloaded from service account

We are using a service account to download files from the server and have reached our storage quota limit. All files were added to a folder created by another user (@ gmail.com account with 100GB storage quota), but all downloaded files belong to the service account.

Please note that we have no real users, we only use Google Drive for storage.

We are currently unable to upload files using a service account.

Is there a way

  • Transfer ownership of all files owned by the service account to an @ gmail.com account with a 100GB storage quota
  • Download files using a service account, but making them the property of the owner of the folder where the file is downloaded.
  • Use @ gmail.com account as service account

thank

+4


source to share


1 answer


To transfer ownership of a file, you can rely on the "insert" method from the Permissions resource. You need fileId as a required parameter and fill the request body with properties for: Role: [owner], Type: [user] and one of these identifiers: [userId on disk] or value: [email from Disk account]. You can find more details at this link: https://developers.google.com/drive/v2/reference/permissions/insert



0


source







All Articles