问题
I have several people contributing files to various folders in Google Drive. Each folder is for a specific project, and has an owner account named to match that project title. I want every file (and its descendants) in that parent folder to be owned by that project account. Eg the folder is called "Conferences", and is owned by the user "conferences.events@mydomain.com". All files uploaded/created into Conferences should be owned by the "conferences.events" account.
What is the easiest way to automate this (I've looked for scripts online), and can someone provide a working example? Thanks.
回答1:
Short answer
The only way "to force" files in folder be owned by the folder owner is that the the other users only have view access to it.
Explanation
If users are able to add files to a folder there is no way to avoid that they add files that are owned by other then the folder owner user.
Workarounds
Instead of allowing users to directly contribute to files to folders, implement other way to add the files to that folder. There are several alternatives:
Use Google Forms. Google recently added a upload file to Google Forms. It's only available to G Suite users. Reference: Edit form, article from Google Docs Editors Help
Create a Google Apps Script Web App. A Web App could create a copy of the a file selected by the user or even it could change the file owner.
- Reference: Transfer ownership of a file to another user in Google Apps Script Q&A from Stack Overflow
Create an app using Google Drive API
- Reference: Transfer Drive files to a new owner, article from the G Suite Administrators Help
来源:https://stackoverflow.com/questions/21892358/how-can-i-force-all-files-in-a-folder-to-be-owned-by-the-folder-owner-in-google