【发布时间】:2019-07-11 03:49:38
【问题描述】:
我在 SQLite 数据库中有一个 BLOB 类型的图像,我想将该图像上传到 Firebase 存储,获取图像的下载 URL 和尺寸,并将它们添加到 Firebase 实时数据库。我已经使用 bucket.upload 从本地驱动器成功上传了一张图片,但我不知道如何上传 Blob。
我在服务器端(NodeJS)使用 admin-sdk,有一个“put”功能,但它在客户端 sdk 中。
bucket.upload("./file.jpeg", options).then(result => {
const file = result[0];
console.log(file)
}).then(results => {
console.log(results);
}).catch(error => {
console.error(error);
});
【问题讨论】:
标签: node.js firebase-realtime-database google-cloud-storage firebase-admin