face detection & firestore & adding images to the messages

This commit is contained in:
2026-06-09 20:53:40 +09:00
parent 69f7cbe833
commit 1f034d72a6
8 changed files with 249 additions and 26 deletions

View File

@@ -0,0 +1,10 @@
import { ref, uploadBytes, getDownloadURL } from 'firebase/storage'
import { storage } from './config.js';
export async function uploadImage(file) {
//create unique file name and stores them in one folder in firebase
const filename = `messages/${Date.now()}_${file.name}`;
const storageRef = ref(storage, filename);
await uploadBytes(storageRef, file);
return getDownloadURL(storageRef);
}