You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project i want to create an empty file in google storage with metadata in one step.
I found this note in gcloud-node/lib/storage/file.js:
...
* @param {object=} metadata - Metadata to set on the object. This is useful
* when you are creating a file for the first time, to prevent making an
* extra call to `setMetadata`.
...
function File(bucket, name, metadata) { }
But i cant find any code that use file.metadata parameter in createWriteStream or getWritableStream_.
Also storage.bucket.file(name) method that created new instance of File not contains metadata parameter.
I know, that i can use createWriteStream(metadata). This is the only way?
The File constructor taking a metadata argument is a relic of old code, I believe.
The problem is, creating a File instance (ex: through storage.bucket.file()) shouldn't have any async/api effects. So, it would be confusing if you said...
varfile=myBucket.file('file-name',{metaprop: 'value'})file.getMetadata(function(err,metadata){/* no metaprop here */})
...because the metadata you "set" wasn't actually set.
Instead, you can explicitly set metadata on a file:
Activity
stephenplusplus commentedon Jan 27, 2015
The File constructor taking a metadata argument is a relic of old code, I believe.
The problem is, creating a File instance (ex: through
storage.bucket.file()) shouldn't have any async/api effects. So, it would be confusing if you said......because the metadata you "set" wasn't actually set.
Instead, you can explicitly set metadata on a file:
Or use
bucket.upload: http://googlecloudplatform.github.io/gcloud-node/#/docs/v0.12.0/storage/bucket?method=uploadtemka1234 commentedon Jan 28, 2015
Thanks for the reply!
chore: update generated protos.js (#363)
build: add Node 8 tests (#363)
build: add Node 8 tests (#363)
build: add Node 8 tests (#363)
build: add Node 8 tests (#363)
feat: move ts target to es2018 from es2016 (#363)
24 remaining items
chore: make test prefix unique per run (#363)
chore(deps): update dependency google-proto-files to ^0.19.0 (#363)
build: add configuration for automated doc deployment (#363)
chore(deps): update dependency google-proto-files to ^0.19.0 (#363)
build: add configuration for automated doc deployment (#363)
Remove unused dependencies (#363)
chore(deps): update dependency jsdoc-region-tag to v3 (#363)
build: add configuration for automated doc deployment (#363)
Release @google-cloud/spanner v2.1.0 (#363)
chore: migrate code from googleapis/gcp-metadata (#53)
Remove unused dependencies (googleapis#363)
chore: drop contributors from multiple places (#363)
chore: drop contributors from multiple places (#363)
chore: drop contributors from multiple places (#363)
chore: drop contributors from multiple places (googleapis#363)