Skip to content

scneba/driveupload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Uploading files from EC2 instance (or any terminal with python support) to Google Drive.

This project shows how to authenticate and upload files to Google Drive using OAuth credentials.

How to run

  • Create python env and activate
python3 -m venv .genv
source .genv/bin/activate
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
  • Create client secret on Google doc and copy to client-secret.json

  • Run the auth.py Python file to authenticate.

  • python auth.py
    
  • Copy generated link and authenticate with Google.

  • Copy resulting link back to terminal and use to autheticate.

  • Update the todos in upload.py and run the file to upload

    #TODO update file to upload and the folder id
    FILE_TO_UPLOAD = 'example.zip' #can be path to file
    REMOTE_FILE_NAME='example.zip' #how to name file on google drive
    FOLDER_ID = '1P_FXOvPvdSAn4_Ho7Qxxxxx' # Gotten from Google drive url of folder
    
    
python upload.py

Read full medium article on project here

About

Upload to google drive

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages