📅  最后修改于: 2022-03-11 14:57:49.953000             🧑  作者: Mango
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");
}
}