Repository navigation
Set initial metadata file on first upload #363
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
Milestone
Description
Activity
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...var file = 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:
var file = myBucket.file('file-name') file.setMetadata({ metaprop: 'value' }, function(err, metadata) {})
Or use
bucket.upload: http://googlecloudplatform.github.io/gcloud-node/#/docs/v0.12.0/storage/bucket?method=uploadThanks for the reply!
- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Feb 2, 2015 - added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 - added a commit that references this issue
on Aug 22, 2022 - added a commit that references this issue
on Sep 16, 2022 24 remaining items
- added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 25, 2026 - added 2 commits that reference this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
In my project i want to create an empty file in google storage with
metadatain one step.I found this note in
gcloud-node/lib/storage/file.js:But i cant find any code that use
file.metadataparameter increateWriteStreamorgetWritableStream_.Also
storage.bucket.file(name)method that created new instance ofFilenot containsmetadataparameter.I know, that i can use
createWriteStream(metadata). This is the only way?