nice blob types and all

This commit is contained in:
talksik
2022-05-29 10:51:04 -05:00
parent 3e76a67f66
commit 8f9cf5bcd2
2 changed files with 14 additions and 5 deletions
@@ -6,12 +6,16 @@ export const uploadAudioClip = async (uniqueFileName: string, blob: Blob) => {
try {
const audioClipsRef = ref(storage, `audioClips/${uniqueFileName}`);
const metadata = {
contentType: blob.type,
};
// 'file' comes from the Blob or File API
const snapshot = await uploadBytes(audioClipsRef, blob);
const snapshot = await uploadBytes(audioClipsRef, blob, metadata);
return await getDownloadURL(audioClipsRef);
} catch (error) {
console.warn('problem in uploading audio clip');
console.warn(error);
throw Error('problem in uploading audio clip');
}