Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Uploading a file with storage and a different key is ... confusing? #787

@jgeewax

Description

@jgeewax

I think the following code works fine on GCE:

from gcloud import storage
bucket = storage.get_bucket('my-bucket')
bucket.upload_file('local.png', 'remote.png')

Now I want to change the credentials, since I'm not on GCE/GAE. How do I do that? Could it be...

from gcloud import storage
storage.set_credentials_json('path/to/creds.json')
bucket = storage.get_bucket('my-bucket')
bucket.upload_file('local.png', 'remote.png')

I couldn't find this in the docs (though I'll admit I didn't scour it to death)... so feel free to close and link if you know where this lives...

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions