justger.blogg.se

How to upload files to shared google drive
How to upload files to shared google drive












how to upload files to shared google drive how to upload files to shared google drive

Replace service.json with the name of your service account key file that you created in step 3b. We will run this app from the command line but you can also convert it to a web app with Google Cloud Run and Docker. Now that the service account is setup, we need to setup a Node.js app that will upload files to Google Drive. Tip: If you are working with the Google Calendar API, you can also share the Google calendar with the service account to have read and write access to the calendar events. The application will not have access to any other resources on your Google Drive. Thus your Node.js application will be able to access this folder and upload files to it.

how to upload files to shared google drive

Right-click the folder, choose Share and add the email address of the service account you created in step 3 as an editor to this folder. Go to your Google Drive and create a new folder. Do not commit this file to the Github repository.įor this example, we are looking to upload files from a local folder to a specific folder in Google Drive. This will download a JSON file that will contain your private key. Select JSON as the Key type and then click Create. Click the Add key drop-down menu, then select Create new key. Click the email address of the service account that you want to create a key for. In the Cloud Console, go to IAM and Admin > Service accounts page. Click Done to finish creating the service account. This is like an email address and will be used to identify your service account in the future. Give your service account a name and a service account ID. In the APIs & Services section, click on Credentials and click on Create credentials to create a service account. If you wish to use the Google Cloud Storage API then you will need to enable Storage API. If you planning to upload files to Google Drive then you will need to enable Drive API. Give your project a name, change the project ID and click the Create button.Ĭhoose APIs & Services from the left menu and click on Enable APIs and Services to enable the various Google APIs. Go to and create a new Google Cloud project. For this example, we have a folder on your local hard drive containing multiple files and we are required to upload these files to a specific folder in Google Drive. This step by step guide will guide you on how to upload files to Google Drive with a service account using Node.js. This tutorial explains how you can connect to Google Drive or any other Google API from a service account without user authentication.














How to upload files to shared google drive