Skip to content

Instantly share code, notes, and snippets.

@tanaikech
tanaikech / submit.md
Last active January 29, 2024 01:17
Uploading Files From Local To Google Drive by Python without Quickstart

Uploading Files From Local To Google Drive by Python without Quickstart

This is a sample script for uploading files from local PC to Google Drive using Python. In this sample, Quickstart is not used. So when you use this script, please retrieve access token.

Curl sample :

curl -X POST \
    -H "Authorization: Bearer ### access token ###" \
    -F "metadata={name : 'sample.png', parents: ['### folder ID ###']};type=application/json;charset=UTF-8" \
    -F "file=@sample.png;type=image/png" \
 "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"