【发布时间】:2019-01-11 00:56:03
【问题描述】:
我的情况是,当我从其他来源接收数据作为 JSON 字符串时,我想将此字符串上传到 Google Cloud Storage,而不将此字符串写入本地文件并上传此文件。有没有办法做到这一点。谢谢你。 如下代码所示
storage
.bucket(bucketName)
.upload(jsonString, { destination: 'folder/test.json' })
.then(() => {
console.log('success');
})
.catch((err) => {
console.error('ERROR:', err);
});
所以我预计 Google Cloud Storage 会有一个文件 test.json,其中包含来自 jsonString 的内容
【问题讨论】:
标签: javascript json node.js google-cloud-storage storage