Upload a file to Google Drive with a service account C#


Fully working example of uploading a file to Google Drive using a service account.

Sharing a folder

This sample can upload to the root directory of the service account or you can specify a directory to upload the file to.

To upload it to a directory on your personal drive account you must share a folder with the service account. Go to the google drive web app and share the folder with the service account as you would share it with a user.


The service account email address can be found in your json key file.


About Linda Lawton

My name is Linda Lawton I have more than 20 years experience working as an application developer and a database expert. I have also been working with Google APIs since 2012 and I have been contributing to the Google .Net client library since 2013. In 2013 I became a a Google Developer Experts for Google Analytics.