📌  相关文章
📜  如何将文件上传到 Firebase 存储 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:49.953000             🧑  作者: Mango

代码示例1
async function uploadBlob(file: Blob | Uint8Array | ArrayBuffer, path: string) {
  try {
    const uploadTaskSnapShot = await storage.ref(path).put(file);
    let url: string = await uploadTaskSnapShot.ref.getDownloadURL();
    return url;
  } catch (error) {
    throw new Error("Could not upload file");
  }
}