I am referring the following code to upload a file into Google Cloud Storage https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/master/3-binary-data/lib/images.js#L48
I was able to upload successfully, Now i am trying to add metadata to file so i have modified the code as below
const stream = file.createWriteStream({
metadata: {
contentType: req.file.mimetype,
foo: 'bar'
}
});
But the foo=bar metadata is not getting attached to the file in Google Cloud Storage