How can I upload a file to Google Cloud Storage from Python 3? Eventually Python 2, if it\'s infeasible from Python 3.
I\'ve looked and looked, but haven\'t found a
Imports the Google Cloud client library (need credentials)
from google.cloud import storage
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="C:/Users/siva/Downloads/My First Project-e2d95d910f92.json"
Instantiates a client
storage_client = storage.Client()
buckets = list(storage_client.list_buckets())
bucket = storage_client.get_bucket("ad_documents")//your bucket name
blob = bucket.blob('/chosen-path-to-object/{name-of-object}')
blob.upload_from_filename('D:/Download/02-06-53.pdf')
print(buckets)