I'm using gcloud-node to store files on Google Cloud Storage. I would like to update metadata, like the timestamp ala touch
. Is that possible?
Asked
Active
Viewed 434 times
2

JJ Geewax
- 10,342
- 1
- 37
- 49

jonathanberi
- 1,867
- 1
- 14
- 24
1 Answers
4
You can pass the metadata to bucket.write
as in:
data = {
data: 'Hello World',
metadata: {
// ...
}
};
bucket.write('HelloMessageFile', data, function(err, fileObject) {});
If you want to update the metadata for an existing file, just pass the metadata inside data
:
data = {
metadata: {
// ...
}
};
bucket.write('HelloMessageFile', data, function(err, fileObject) {});

Silvano
- 1,005
- 6
- 6