import { initializeApp } from 'firebase/app';
import { getAuth, GoogleAuthProvider, signInWithPopup } from 'firebase/auth';
import { getStorage, ref, uploadBytes, deleteObject, getDownloadURL } from 'firebase/storage';
const firebaseConfig = {
apiKey: "AIzaSyAPJ44X28c .... 6FnKK5vQje6qM",
authDomain: "fir-expts-app.firebaseapp.com",
projectId: "fir-expts-app",
storageBucket: "fir-expts-app.appspot.com",
messagingSenderId: "1070731254062",
appId: "1:10707312540 ..... 61bd95caeacdbc2bf",
measurementId: "G-Q87QDR1F9T"
};
const app = initializeApp(firebaseConfig);
const storage = getStorage(app);
window.onload = function () {
document.getElementById('fileitem').onchange = function () { uploadFile() };
}
function uploadFile() {
const file = document.getElementById('fileitem').files[0];
const filename = document.getElementById('fileitem').files[0].name;
const storageRef = ref(storage,filename );
uploadBytes(storageRef, file).then((snapshot) => {
alert('Successful upload');
});
}