Cloud drive services like Google Drive make sharing files and folders, and collaborating on them, incredibly easy. Google Drive has an entire suite of web apps built on top of Google Drive so that people can come together and work. When you share files and folders via Google Drive, you can restrict who has editing and viewing access. If at any time you want to revoke access to a file, you can edit and remove people easily enough. The process isn’t automated and you have to remove people individually because Google Drive doesn’t let you create auto-expiring links. To share files from Google Drive that expire automatically after a number of hours/days/weeks/months, you need a script called Set Expiration Dates for Google Drive Links. It’s a simple little script developed by Amit Agarwal that does the job perfectly.
Visit Set Expiration Dates for Google Drive Links and grant it permission to access the files in your Google Drive.
Next, click the Open Drive button and select either a file or a folder to share.
Enter email addresses of whoever you want to share the file with. You can give someone viewing and/or editing access. When the link expires, both types of access are removed.
Next, set the expiration time. The script won’t let you pick a specific date or time. What you can set is relative time i.e. a certain number of hours from the time the file/folder has been shared. The smallest unit of time you can set expiration in is hours. Click the ‘Set Expiration’ button and your file will be shared immediately.
Your recipient is sent the file via email. It gives no indication that the file is only available for a certain time so make sure you let your recipient know about its eventual expiry.