

Click on Libraries and add the OAuth2 library 1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF to your project. Go to script.new to create a new Google Apps Script project. You will need these credentials to upload files to Google Cloud Storage.
#Google drive storage download
This will download a JSON file containing the service account credentials. Go to the “Keys” tab and click on “Add Key” > “Create New Key,” and select the JSON option. You may also want to add the “Service Account Token Creator” role to the service account, as this is required to create signed URLs for the files you upload to Google Cloud Storage.įrom the list of service accounts, click the one you created in the previous step. Its available to all Stanford affiliates. Give your service account a name and select the “Storage Admin” role. Google Drive is a web and desktop file sync and share service thats part of Google Workspaces (formerly G Suite). Next, go to IAM & Admin > Service Accounts /iam-admin/serviceaccounts/create and create a new service account. If the files you are uploading are private and you don’t want to make them public anytime later, you may enable the “Enforce public access prevention on this bucket” option. Give your bucket a unique name and select the region where you want to store your data. Once the project has been added, go to /storage/create-bucket and create a new bucket. To get started, go to /projectcreate and create a new Google Cloud Project.

The same technique can also be used to upload files from Google Drive to Firebase Storage. You can even set up a time-based trigger, like a cron job, that watches a folder in your Google Drive and automatically upload new incoming files to Google Cloud Storage. This tutorial describes how you can upload files and folders from your Google Drive to a bucket in Google Cloud Storage using Google Apps Script. Google Drive is a file storage and synchronization service developed by Google.Launched on April 24, 2012, Google Drive allows users to store files in the cloud (on Googles servers), synchronize files across devices, and share files. This tutorial describes how you can upload files and folders from your Google Drive to a bucket in Google Cloud Storage using Google Apps Script.
